the below table is order by rank .. however i want order by in a way that 'Cpl' comes first. 'lcpl' comes second and 'pte' come last.. if i use ascending or descending it will order by a random manner.
fire eaters
0
Newbie Poster
Recommended Answers
Jump to PostSELECT * FROM table ORDER BY rank, name asc will order it first by rank (Cpl, Lcpland Pte) and then order by name within each rank. What code were you using to get a random result?
All 5 Replies
hericles
289
Master Poster
Featured Poster
fire eaters
0
Newbie Poster
fire eaters
0
Newbie Poster
rajeevphp2011
-3
Newbie Poster
hericles
289
Master Poster
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.