Results 1 to 4 of 4

Thread: problem in select statement

  1. #1
    Junior Member
    Join Date
    Aug 2007
    Answers
    2

    Smile problem in select statement

    i want to retrieve data from two tables,but in single row i want these.
    suppose there r two tables,in which deptid are foreignkey,where deptid=10,i want one name from table,& where deptid=20,I want another name,please verify this."urjent"


  2. #2
    Contributing Member
    Join Date
    Sep 2005
    Answers
    91

    Re: problem in select statement

    select a.column1, b. column2 from table1 a , table2 b whre a.depid = 20

    you can include as many columns you want considering table1 as a , and table 2 as b.. just add the column names as in table...


  3. #3
    Expert Member
    Join Date
    Oct 2007
    Answers
    375

    Re: problem in select statement

    I guess this should help

    Select a.deptid, b.deptid, b.name from table1 a, table2 b
    where a.deptid = b.deptid
    and b.deptid = 20 or b.deptid = 10


  4. #4

    Re: problem in select statement

    select table1.name, table2.deptid
    from table1, table2
    where table2.deptid=10 and table2.deptid=20


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact