Forums Register Login

Sorting in MYSQL

+Pie Number of slices to send: Send
How can we print the output retrived from the database in ascending or descending order in case of "MYSQL" on the basis of 2 fields(date & time).
For example :
while(rs.next())
{
time=rs.getString("time");
date=rs.getString("date");
sendto=rs.getString("sendto");
sendfrom=rs.getString("sendfrom");
Date: <%= date %>


Time: <%= time %>


To: <%= sendto %>


From: <%= sendfrom %>


}
+Pie Number of slices to send: Send
Hi,
I believe the answer to your question is to include an "Order By" clause in your query.
Good luck
VG
My name is Inigo Montoya, you killed my father, prepare to read a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 694 times.
Similar Threads
today's date & time
ClassNotFoundException with ResourceBundle
collections help
Timing Issues Error/normal HSQLDB/ Java doubt
Java date to MySQL date conversion
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 18, 2024 23:17:36.