Skip to content
Advertisement

How to segregate data from each other with same value

I’ve got 2 tables in my database the first table is

leader

JavaScript

member

JavaScript

And what I want is like this

JavaScript

My query

JavaScript

I’ve tried using UNION and JOIN but it’s not working. Can someone help me, and form of help will very much appreciated. Thanks everyone!

Advertisement

Answer

You can use UNION ALL like this:

JavaScript

Results:

JavaScript

Or:

JavaScript

Results:

JavaScript

See the demo.

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