Skip to content

Tag: group-by

group by issue in sql

i’m trying to get in a new column the sessions who are between 08:00 and 18:00. You can see my last CASE in the CTE. For each date there should be a new column “TotalRestrictedSessions” which indicate how many session were on that particular date. If there are none, in this case i have to wr…

SQL statement about average

My question is -> Retrieve the segment ID and length of each segment that is longer than the average length of all segments. Name the column indicating the length of segments “Length”. Relations: What I got so far is: And I got this error message: Error: Your query has syntax errors. Descriptio…