-
Junior Member
interview question
Hello,
It is Interview Quetion,I am joing 5 tables,if query is too long,what i have to do,what are the other option?
-
Contributing Member
Re: interview question
other option is to use subquery for example
select * from table1 where col1 in (select col1 from table2 where col2 in (.................))))
----V V----
Vikas Vaidya
(Please mark the quote as thanks if u found the answer useful)
-
Junior Member
Re: interview question
Then go for coralated sub query...its give better performance also....
-
Junior Member
Re: interview question
Hello,
Your question is not clear. From what I understood and will do
1. First check how many rows are there in the individual tables that need to be joined.
2. Then note down the foreign key columns.
3. Get the data in to temporary table(s) by joining 2 tables at a time which will be easy when writing the final query to output the result set.
Hope this helps.
Thanks
-
Junior Member
Re: interview question
Hi Nithya !! Jameel here,
You can go for views as views are compiled select statements and can span across multiple tables
-
Contributing Member
Re: interview question
Hai,
It is very much better to use the sub queries.
If we use the views it is nested upto 32 levels only..
If it crossed you may get errors.
-
Junior Member
Re: interview question
use the views to simplify tasks
-
Junior Member
Re: interview question
views is the best solution for this.....
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules