Reputation: 149
I would like to get results where value in one column is greater than values in another.
Example
select * FROM myTable where column time_taken is greater than time_spent
Thanks for the help.
Upvotes: 1
Views: 11035
Reputation: 20840
select * FROM myTable where time_taken > time_spent
To see a list of other operators available in MySql, have a look at http://dev.mysql.com/doc/refman/5.0/en/non-typed-operators.html
Upvotes: 3
Reputation: 9635
select * from myTable where time_taken > time_spent
Figuring out less than, less than equal to, greater than or equal to is left as an exercise to the reader.
Upvotes: 1