Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Database > SQL Language
| Search | Today's Posts | Mark Forums Read
SQL Language SQL Language discussions not specific to a particular RDBMS program or vendor.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Language section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #11 (permalink)  
Old May 31st, 2006, 01:13 PM
Authorized User
 
Join Date: May 2006
Location: , , .
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

yes

  #12 (permalink)  
Old May 31st, 2006, 01:51 PM
Authorized User
 
Join Date: Mar 2006
Location: London, , United Kingdom.
Posts: 73
Thanks: 0
Thanked 0 Times in 0 Posts
Default

you could try

Code:
SELECT DISTINCT 
        UPPER(REQUESTER_F_NAME) AS Expr3, 
        UPPER(REQUESTER_L_NAME) AS Expr4, 
        UPPER(REQUESTER_SFID) AS Expr2, 
        max(REQUESTER_PHONE), 
        max(SUBSTRING(REQUEST_ID, 1, 2)) AS office, 
        max(REQUESTER_DEPT)
FROM         
        dbo.RH902
GROUP BY 
        UPPER(REQUESTER_SFID), 
        UPPER(REQUESTER_F_NAME), 
        UPPER(REQUESTER_L_NAME)        
ORDER BY 
        UPPER(REQUESTER_SFID), 
        UPPER(REQUESTER_F_NAME), 
        UPPER(REQUESTER_L_NAME), 
        max(REQUESTER_PHONE), 
        max(SUBSTRING(REQUEST_ID, 1, 2)), 
        max(REQUESTER_DEPT)


if this doesnot work, can you give me an actual example of what the initial table looks like, ie data, and what you want to produce

  #13 (permalink)  
Old May 31st, 2006, 02:00 PM
Authorized User
 
Join Date: May 2006
Location: , , .
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Awesome, thank you. I will name my fouth child after you. Seriously, this has been driving me crazy and now i can get beyond it.

Extended

  #14 (permalink)  
Old May 31st, 2006, 02:01 PM
Authorized User
 
Join Date: Mar 2006
Location: London, , United Kingdom.
Posts: 73
Thanks: 0
Thanked 0 Times in 0 Posts
Default

you're welcome..





Similar Threads
Thread Thread Starter Forum Replies Last Post
Select Query gregalb SQL Server 2000 2 November 15th, 2007 10:56 PM
SELECT from SELECT query? seananderson Access 1 October 12th, 2007 12:40 AM
Need help on select query arul1984 SQL Server 2000 2 July 4th, 2007 01:49 AM
Select query help minhtri SQL Server 2000 4 March 28th, 2005 06:59 PM
select query collie SQL Server 2000 2 January 17th, 2005 03:13 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.