I want to select rows from a table where the value of column_x is less than column_y. This is what I’ve got:
$query = "SELECT *
FROM table_name
WHERE timestamp <= '$timestamp'
AND hit_counter <= max_hits";
Does anyone have any idea if this will work, and if not what I could do to get this kind of functionality :).
It works perfectly. Here’s a test case in SQL Server but it’s the same in MySQL: