Skip to content
Advertisement

how to solve this query using union

Display id and name for salesmen along with id and category of products in a single table. Indicate the source of the row in result by adding an additional column TYPE with possible values as ‘S’ (Salesman) and ‘P’ (Product). Display all rows.

I don’t how to add column “type” without using alter

actual tables are

Salesman Table

Product Table

expected output

Advertisement

Answer

You want result like this?

You can try query like this

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