Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2009
    Posts
    73

    Question Unanswered: Help for select query....Pls HELP!!!!

    I have a table with two columns
    account no ----------dept ID
    463-------------------------121
    463--------------------------388
    500---------------------------400
    500---------------------------999




    i want output to be

    account no--------------deptid
    463-----------------121
    500-----------------400

    what select query should i write to get it pls help i m new to this

  2. #2
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    Try

    SELECT AccountNo, Min(DeptID) AS MinID
    FROM TableName
    GROUP BY AccountNo
    Paul

  3. #3
    Join Date
    Mar 2010
    Posts
    15
    Or try:

    SELECT * FROM TableName
    WHERE DeptID IN (121,400)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •