aspose file tools
The moose likes JDBC and the fly likes order by date_arrive but what if... Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "order by date_arrive but what if... " Watch "order by date_arrive but what if... " New topic
Author

order by date_arrive but what if...

Peter Primrose
Ranch Hand

Joined: Sep 10, 2004
Posts: 755
Assuming I have a table with the following attributes:

Name date arrive


Say, for example, I have the following information � they are ordered by date

Name date arrive
Dan 1-feb-2005
James 5-feb-2005
Gore 6-feb-2005

Now, say Gil comes on 6-feb-2005 so the result will be:

Name date arrive
Dan 1-feb-2005
James 5-feb-2005
Gore 6-feb-2005
Gil 6-feb-2005

What if I want Gil to come before Gore (they are on the same date BUT Gil is before GORE � in the alphabetic order)

Does anyone have idea what the SQL Statement to be?

I have

Select Name, Date_Arrive from myTable order by Date_Arrive
Loren Rosen
Ranch Hand

Joined: Feb 12, 2003
Posts: 156
You can sort by more than one column:

Select Name, Date_Arrive from myTable order by Date_Arrive, Name
Peter Primrose
Ranch Hand

Joined: Sep 10, 2004
Posts: 755
thanks this solves the problem
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: order by date_arrive but what if...
 
Similar Threads
Colors in JTable - unexpected result when scrolling
Help with queue program
Date & Time Problem
Gore Calls for Rumsfeld, Rice and Tenet to Resign
insert or update???