# 2 Quick SQL Questions: Paginate Conditions and Adding to Val

**URL:** <https://www.ruby-forum.com/t/2-quick-sql-questions-paginate-conditions-and-adding-to-val/104608>\
**Category:** Rails\
**Created:** [May 20, 2007, 5:14pm UTC](https://www.ruby-forum.com/t/2-quick-sql-questions-paginate-conditions-and-adding-to-val/104608 "2007-05-20T17:14:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [May 20, 2007, 5:14pm UTC](https://www.ruby-forum.com/t/2-quick-sql-questions-paginate-conditions-and-adding-to-val/104608/1 "2007-05-20T17:14:59Z")

</div>

I have 2 quick SQL questions that all my googling couldnt come up with  
an answer

1. Paginate results based on 2 conditions

I currently have sorthelper sorting based on title/author. I’d like  
the option to select based on 3 genres then be able to sort that  
through those results by title. I haven’t be able to see how to handle  
sorting with a variable condition. (codes below

1. How to add to current value

How would I add to a current value in my table?

value = value.current + value.new
