i have column a ,column b in emp table. i like to retrieve values from that column find the difference between them. if i get 0 as difference i will return true else i will return false using functions.i am new to database so only i don't know how to do this.i like to know how to store the retrieved values from table to variable. i dont know how to return a value.
+2
A:
MySQL doesn't really have booleans. TRUE
and FALSE
are aliases to 1 and 0, and the BOOL
column type is just an alias for TINYINT(1)
. All expressions that appear to give boolean results actually return 0 or 1.
You could write your query as:
SELECT (a = b) AS a_equals_b
FROM emp
WHERE ...
Mark Byers
2010-07-12 11:37:14
A:
Flakron Bytyqi
2010-07-12 11:37:32