Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- then perform this select on table 1 (select one),
- SELECT IF (1=1,"YES", "NO"), but, when I replace 1=1 with my select, like this:
- SELECT IF ((SELECT count(*) FROM Table1)>0,"YES", "NO")
- SELECT
- IF(inner_table.count_column > 0, "YES", "NO) -- here we select the 'count_column' from 'inner_table
- FROM
- (
- (SELECT count(*) as count_column FROM table1)
- ) as inner_table -- aliasing the inner select as 'inner_table'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement