• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Sorting in MYSQL

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 %>


}
 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I believe the answer to your question is to include an "Order By" clause in your query.
Good luck
VG
 
reply
    Bookmark Topic Watch Topic
  • New Topic