Does anyone know how to select those rows where x > y, where x and y both are table columns.
$query = mysql_query("SELECT * FROM table WHERE x > '???' ");
To get all rows where the column x
value is greater than that in column y
it is this simple.
SELECT * /*BTW - Don't use *. List desired columns explicitly*/
FROM table
WHERE x > y;
You can specify column names anywhere a value would be valid, even on both sides of a relational operator.
SELECT *
FROM table
WHERE x > y