I have a SQL query where I get the count of something, but what I really
want is a yes/no (boolean) answer. Here is my query:
SELECT COUNT(*) AS COUNT FROM hd_entries,hier archy WHERE
IFNULL (BETWEEN_TIMES (b_yr, b_day, b_msec, e_yr, e_day, e_msec,
2001, 31, 0, 2001, 31, 63720000) >0, 1) AND
hd_entries.data _key=hierarchy. data_key AND
hierarchy.proje ct='CLUSTERII' AND
hierarchy.missi on='CLUSTER-4' AND
hierarchy.exper iment='PEACE';
Is there a way to change this such that it will only return a 0 or 1. Our
hope is that this makes the series of queries that I need to do go that much
quicker. The BETWEEN_TIMES function is a routine that I wrote that returns
a -1, 0, 1 if the entry sent in to it is between the given times.
I'm using MySQL v3.23.58 if it matters.
Thanks!
Joey
Comment