databases

Discussion in 'Databases' started by sourabhsharma.obizm, Aug 24, 2012.

  1. #1
    How can i retrive all records from two tables tbl1 and tbl2 without using joins?
     
    sourabhsharma.obizm, Aug 24, 2012 IP
  2. Calixarene

    Calixarene Greenhorn

    Messages:
    21
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #2
    Select * from db.tbl1
    ;
    Select * from db.tbl2
    ;
     
    Calixarene, Aug 25, 2012 IP
  3. Sarah Reece

    Sarah Reece Greenhorn

    Messages:
    11
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    13
    #3
    If both tbl1 and tbl2 have the same structure, you could use UNION.
    select * from tbl1
    UNION
    select * from tbl2;

    But if they have different structures and you want to retrieve columns from both tables in a single row, then it may not be possible to do this without using a join.
     
    Sarah Reece, Aug 25, 2012 IP
  4. advertise3110

    advertise3110 Greenhorn

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    21
    #4
    I am interested in this too
     
    advertise3110, Aug 25, 2012 IP
  5. abhishekabhi

    abhishekabhi Greenhorn

    Messages:
    57
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    18
    #5
    HI

    database is collection is record and table.
     
    abhishekabhi, Sep 3, 2012 IP