Boolean query result
-
I am querying a table to see if a person ID exists on the table using e.g. : select IF(Count(*),0,1) from transactionlog where person_id = 1 What I want is something that returns a boolean true or false e.g. select TRUE from transactionlog where person_id = 1. Does such a feature exist? GER
Ger
-
I am querying a table to see if a person ID exists on the table using e.g. : select IF(Count(*),0,1) from transactionlog where person_id = 1 What I want is something that returns a boolean true or false e.g. select TRUE from transactionlog where person_id = 1. Does such a feature exist? GER
Ger
You might try the following, but remember that
TRUE
andFALSE
are equal to1
and0
in MySQL:SELECT IFNULL(COUNT(*)>0,0) FROM transactionlog WHERE person_id=1;
CQ de W5ALT
Walt Fair, Jr., P. E. Comport Computing Specializing in Technical Engineering Software
-
I am querying a table to see if a person ID exists on the table using e.g. : select IF(Count(*),0,1) from transactionlog where person_id = 1 What I want is something that returns a boolean true or false e.g. select TRUE from transactionlog where person_id = 1. Does such a feature exist? GER
Ger