homepage Welcome to WebmasterWorld Guest from 23.20.34.25
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Subscribe to WebmasterWorld

Home / Forums Index / Code, Content, and Presentation / Databases
Forum Library, Charter, Moderators: physics

Databases Forum

    
sorting twice on same field
sorting twice on same field
Tourex




msg:3821266
 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.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved