Skip to content

Insert data using two select queries with different count of rows

I Wish to enter data into a third table while getting the data from the first two tables.In this case the first table is profile and second table is menu, and the third table is profile_menu. My objective is to map menus to a specific profiles.Practically one profile can have mapping to multiple menus. I am using the below query :

While running this i am getting “01427. 00000 – “single-row subquery returns more than one row”” this error. I Understand that i need the same rows in select of profiles but i am not getting how to acheive that.

If anybody can help.

Thanks.

Advertisement

Answer

If I understand, use join:

This will return multiple rows. That is presumably what you intend.

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