0 0 votes If aggregate functions are used in the select clause along with attribute list we must use group by clause for grouping the attribute values ? SELECT a1, COUNT(*) FROM Employee Is above query right or wrong ? Databases sql databases + – vishal burnwal 1.3k views answer comment Share Follow Print See all 6 Comments 6 6 Comments reply Shaik Masthan commented Aug 22, 2018 reply Follow flag should be wrong... the query should be like SELECT a1, COUNT(*) FROM Employee groupby a1 0 0 replyShare vishal burnwal commented Aug 23, 2018 reply Follow flag Means you are saying that whenever aggregate functions are used in the select clause along with attribute list then groupby clause must be present in the query ,right? 1 1 replyShare Shaik Masthan commented Aug 23, 2018 reply Follow flag yes 0 0 replyShare srestha commented Aug 23, 2018 reply Follow flag count doesnot need group by even having also doesnot need group by every time right? 0 0 replyShare Shaik Masthan commented Aug 24, 2018 reply Follow flag but in this example he used attribute in select clause, therefore it must required groupby clause if there is no attribute used in select clause, then your statements are true 0 0 replyShare Mk Utkarsh commented Aug 24, 2018 reply Follow flag This query will ouput 1'st value of a1 along with number of rows in relation which are not null. 0 0 replyShare Please log in or register to add a comment.