Skip to content
Advertisement

need to form SQL join/subQuery on multiple tables

There are 3 tables –

tables — columns

ABC – abc_id, abc_name, active_flag

XYZ – xyz_id, xyz_name, active_flag

ABC_XYZ – abc_xyz_id, abc_id, xyz_id, active_flag

id column in each table is PK I need to form a query which will return output like – for each abc_name there will be multiple xyz_names

like below –

abc_name1 –

abc_name2 –

I am using sybase DB in my project

any help will be appreciated

Advertisement

Answer

To join all 3 your tables, you can start fro the table ABC_XYZ as shown below-

You can get some more details HERE about SQL JOIN

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