Skip to content
Advertisement

How merge these two sql queries in mysql?

I want to merge below two queries and display two p_artist.id count based on the condition of each band name but I am not getting any clue. Can anyone help me, please?

Thanks

Advertisement

Answer

I mean I want to have two-column of count ids

The requirements are not clear at all and I had originally typed a separate answer, but in light of the comment above I think you’re looking for something like this.

It sums each case statement into its own column.

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