I have some reports in a sql database. Some reports have a report number, some reports don’t have a report number.
Report_id | Report_created_by | Versions | Report_number |
---|---|---|---|
1 | John Smith | 1 | 101 |
2 | John Smith | 2 | 101 |
3 | Jack Johson | ||
4 | Madeline Joe |
I would like to group reports that have a report number, and list all reports that don’t have a report number.
so I should get a result like this:
Report_id | Report_created_by | Versions | Report_number |
---|---|---|---|
1 | John Smith | 1 | 101 |
3 | Jack Johson | ||
4 | Madeline Joe |
How should I write my sql query?
thank you.
2