0
How to use group by clause in sub query?
4 Answers
+ 3
When using sub query make sure you use the same column name as mentioned in group by. Otherwise it will throw an error. You could use scalar function like avg, max.. Etc in select clause
Example
Select * from Tablename where id in ( select id from idtable group by id having count(id) >2.
+ 1
just in the same way that we use on the queries
0
select * from table_name where attribute_name in (select *from table_name where condition group by attribute_name)
0
Use same as normal