Results 1 to 2 of 2

Thread: Distinct Query

  1. #1
    Join Date
    Apr 2004
    Location
    Melbourne
    Posts
    144

    Unanswered: Distinct Query

    When i run this query,
    select distinct(firstname + ' ' + lastname), firstname, lastname, department
    from tbltest

    it brings out 149 records

    but when i run it with the extension field

    select distinct(firstname + ' ' + lastname), firstname, lastname, department, extension
    from tbltest

    Is there like a limit to the distinct query on the number of columns returned ?

  2. #2
    Join Date
    Feb 2004
    Location
    Bangalore, India
    Posts
    250
    Quote Originally Posted by jcwc888

    first query

    select distinct(firstname + ' ' + lastname), firstname, lastname, department
    from tbltest

    2nd query
    select distinct(firstname + ' ' + lastname), firstname, lastname, department, extension
    from tbltest
    hi,

    r u getting a different no of records when the 2nd query is executed?

    if so, the fields SELECTed by the second query will not be DISTINCT (with extension added to the SELECT list)
    Cheers....

    baburajv

Posting Permissions

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