MySQL Forums
Forum List  »  Connector/C (libmysql)

Re: doubt in select query
Posted by: Markus Popp
Date: April 27, 2005 07:53PM

You can't be sure about the order that a query returns without adding an order statement to your SQL query.

If you want to get a result in a special order which is not equal to any data of a column you'll do best to add a new column with index values which specify the order (e.g. 10 for 526, 20 for 504, 30 for 503 and 40 for 503). Then your query will look something like this:

select * from Currency order by order_column

Hope, this helps ;-).

Greetz,
Markus

Options: ReplyQuote


Subject
Views
Written By
Posted
791
April 27, 2005 10:41AM
Re: doubt in select query
590
April 27, 2005 07:53PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.