Get 1 if number of column column in one table is equal to number of rows
in other table
I have following two tables
table a->
Class_ID | name | class |
1 | abc | a |
1 | def | a |
2 | ghi | b |
2 | jkl | b |
2 | mno | b |
3 | pqr | c |
3 | stu | c |
table b->
Class_ID | class |
1 | a |
1 | a |
2 | b |
2 | b |
3 | c |
3 | c |
I want the result to return 1 for CLASS_ID = 1 & 3 and 0 for CLASS_ID = 2,
i.e. query should return 1 if number of rows in table a is equal to no of
rows in table b.
No comments:
Post a Comment