How to get data from multiple tables?

  • Hi Friends,

    How to get specified data from multiple tables( more than 10 tables) without using nested queries?

    Regards,

  • Are you asking about Join statements in the From clause? You can include way more than 10, without nested queries.

    This sounds like a homework/test question. Is it?

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • Hi ,

    To get data from 'n' number of tables you can use the JOIN predicate. But personally I feel joining more tables will always hinder the process and data fetching can get longer.However, having said that if your tables are small enough for 9 JOINs to work then you can very well proceed with that.

  • arun1_m1 (12/27/2011)


    Hi ,

    To get data from 'n' number of tables you can use the JOIN predicate. But personally I feel joining more tables will always hinder the process and data fetching can get longer.However, having said that if your tables are small enough for 9 JOINs to work then you can very well proceed with that.

    And, of course, if you need data from all those tables, and it needs to be in a single dataset for the application to consume it, then Join is generally going to be the way to do it.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply