开发者

how to select those rows where x > y

开发者 https://www.devze.com 2023-04-05 18:43 出处:网络
Does anyone know how to select those rows where x > y, where 开发者_如何学JAVAx and y both are table columns.

Does anyone know how to select those rows where x > y, where 开发者_如何学JAVAx 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
0

精彩评论

暂无评论...
验证码 换一张
取 消