Sunday, 17 September 2017

Group By Clause

GROUP BY clause is use to group the rows.

Syntax:
SELECT column1,groupfunction(column)
FROM TableName
WHERE Conditions
GROUP BY columns
HAVIN filters
ORDER BY columns;

How GROUP BY clause works:

SELCT job FROM EMP;

SELECT JOB FROM EMP GROUP BY EMP;



Guidelines:
  • Non group functional columns should be declare in GROUP BY clause
  • WHERE clause will filter the records before the grouping the records.
  • Columns aliases can not be used in GROUP BY clause.
  • All the SELECT list column must be part of GROUP BY but all GROUP BY columns may not be part of SELECT list.

2 comments:

  1. Reach to the best Data Science Training institute in Chennai. for s/kyrocketing your career, Infycle Technologies. It is the best Software Training & Placement institute in and around Chennai, that also gives the best placement training for personality tests, interview preparation, and mock interviews for leveling up the candidate's grades to a professional level.

    ReplyDelete