• bvinay57 (4/17/2009)


    Hi

    thanx for ur immediate response in my db i have Table1,Table2,Table3 tables i want to retrive data using select statement first i want to retrive data from Table1 after finishing Table1 now i want to retrive data for Table2 like this Table3 so i think it is better to go with while loop Table1,Table2,Table3 contains similar fields.So no problem arises

    There are far too many different ways of interpreting your requirement, you must provide much more information than this. What data do you want to retrieve from table1? Having retrieved it, do you want to add a subset of table2 to it? As rows or columns? What about table3?

    How are the three tables related? What is the business context?

    “Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

    For fast, accurate and documented assistance in answering your questions, please read this article.
    Understanding and using APPLY, (I) and (II) Paul White
    Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden