Jump to content

INNER JOIN ON Index


abdfahim

Recommended Posts

I have 4 tables, each table has many columns, but the column a,b,c are common. In each table, I made a Unique Index on a,b,c -

CREATE UNIQUE INDEX abc ON tbl (a, b, c)

Now I want to Inner Join these 4 table with

 

table1.a=table2.a=table3.a=table4.a AND
table1.b=table2.b=table3.b=table4.b AND
table1.c=table2.c=table3.c=table4.c

 

I wonder if there is a way (or it is advisable) that rather than writing this large code, i use the index to inner join the tables like

 

table1.abc=table2.abc=table3.abc=table4.abc

 

Link to comment
https://forums.phpfreaks.com/topic/84700-inner-join-on-index/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.