Skip to content
Advertisement

SQL Select – Get a count of data as a separate column error

I am working on this query whereas I have a table as follows

I need to get a count of codes in a separate column only for the date of 20-JUN

Here’s the query I am trying.

This however does not give me the desired outcome, except it returns this.

I still cannot figure out how to change the query to get the outcome I need. Can anyone please help?

Thanks in advance!

Advertisement

Answer

You seem to just want aggregation:

This assumes that date is stored as a date, and that your database, which you did not tell, supports the standard syntax to declare literal dates.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement