grabmail
01-08-2006, 04:55 PM
right now, my query is
select value from table1 where col = value limit 1 UNION select value from table2 where col = value limit 1
is this the most efficient way to do it?
i tried to select count instead but it doesn't work. I don't know why. Count doesn't seem to work with UNION. When i tried it, it only return the count from table1. table2 is ignored.
select value from table1 where col = value limit 1 UNION select value from table2 where col = value limit 1
is this the most efficient way to do it?
i tried to select count instead but it doesn't work. I don't know why. Count doesn't seem to work with UNION. When i tried it, it only return the count from table1. table2 is ignored.
