Sql Group By Day Names – Query Examples

Sql Group By Day Names

To qroup queries day name we must use datename function in sql. This function gets two parameter. The first one is interval;for day names we should write dw, for month names we shoul write m or mm. The second parameter is the date parameter. We will write examples on library database.

TO DOWNLOAD THE SAMPLE LİBRARY DATABASE CLICK

Example 1 :

List the days of week and the student count born in that day;

Result:

Example 2: 

List the days of week and the taken book count in that day

Example 3: Find the day of the most taken book by all students

Result:

 

YOU MAY WANT TO SEE OUR ALL EXAMPLES PAGE, THEN CLICK HERE

About the author

admin

Leave a Comment

%d bloggers like this: