abdfahim Posted January 6, 2008 Share Posted January 6, 2008 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 Quote Link to comment https://forums.phpfreaks.com/topic/84700-inner-join-on-index/ Share on other sites More sharing options...
Barand Posted January 6, 2008 Share Posted January 6, 2008 FROM table1 INNER JOIN table2 USING (a, b, c) INNER JOIN table3 USING (a, b, c) INNER JOIN table4 USING (a, b, c) Quote Link to comment https://forums.phpfreaks.com/topic/84700-inner-join-on-index/#findComment-431834 Share on other sites More sharing options...
fenway Posted January 6, 2008 Share Posted January 6, 2008 I still prefere the ON clause to USING... there is a different for SELECT * expansion. Quote Link to comment https://forums.phpfreaks.com/topic/84700-inner-join-on-index/#findComment-432109 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.