Skip to content
Advertisement

MySQL query to Retrieve Main record from main table and Sub records from another table in a single SQL statement

I have following Two tables

Table Name: category

Table Name: product

Now I am looking for single SQL statement which should retrieve everything in a single sql statement.

Expected output given below:

Advertisement

Answer

You can use union all:

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