Sorting in MYSQL

Sehgal Amit

Greenhorn

Posts: 2

posted 15 years ago

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 %>

}

Vernon Gibson

Ranch Hand

Posts: 35

posted 15 years ago

Hi, I believe the answer to your question is to include an "Order By" clause in your query. Good luck VG