abahaedini Posted July 25, 2012 Share Posted July 25, 2012 (edited) I have 4 tables: table_1:Name id_table_1 value ---------|-----------------------|--------------------|----------------------DATA 5 book table_2:Name id_table_2 value Foreign_ id_table_1--------|--------------------|----------------------|-----------DATA 12 compueter 5 table_3:Name id_table_3 value Foreign_id_table_2---------|-------------------|-------------------------|----------------------------------DATA 14 programming 12 table_4:Name id_table_4 value Foreign_id_table_3--------|----------------------|--------------------------|--------------------------------DATA 20 Leran SQL 14 Now, I have 3 values: id_table_1,id_table_2,id_table_3 how can I select the value of table_1 with least query? note: i wana be sure parent is table_4 and tab;e_3 and table_2 is true! i wrote a code: <select value form table_1jjoin_inner table_2jjoin_inner table_3join_inner table_4whereForeign_id_table_3 == id_table_3andForeign_id_table_2 == id_table_2andForeign_id_table_1 == id_table_3 it's true or not? Edited July 25, 2012 by abahaedini Link to comment Share on other sites More sharing options...
birbal Posted July 25, 2012 Share Posted July 25, 2012 (edited) check about join here http://www.google.co...O4i2-l6UslF5wRA Edited July 25, 2012 by birbal 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now