homepage Welcome to WebmasterWorld Guest from 54.226.192.202
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / Databases
Forum Library, Charter, Moderator: open

Databases Forum

    
sorting twice on same field
sorting twice on same field
Tourex

10+ Year Member



 
Msg#: 3821264 posted 6:32 pm on Jan 7, 2009 (gmt 0)

Can some expert help save the sanity of this sad newbie before I go totally insane trying to figure it out.

I have a large table containing reservations. Reservation can have multiple 'lines', each with a different date. I want to produce reports listing all reservations in date order, but with ALL lines for each reservation then listed sequentially in the same group.

For example, the table contains:

ResNo Date
45678 2009-02-03
12345 2009-02-02
23456 2009-01-01
12345 2009-02-06

And I want a report listed like:

2009-01-01 23456
2009-02-02 12345 *
2009-02-06 12345 *
2009-02-03 45678

My question is how would I achieve this with a SELECT statement? I assume it would require a sub-query, but this is outside my experience and a few pointers would be appreciated.

Thanks in anticipation of any help.

 

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Databases
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved