I have created a small 4 column d-base and if I do a "select * from table" 
sqlite always returns to me the order of the data in the order that it was 
listed in the create statement.  (Actually, I based a lot of functionality in a 
small C++ program I wrote on this, and it has never failed.  I've only recently 
modified it, to help ensure that it never fails.)  Again, to ensure your 
getting the columns in the right order you could specify the order in a select 
statement.

Puneet Kishor <[EMAIL PROTECTED]> wrote:

On Jul 22, 2005, at 2:11 AM, LURKIN Denis wrote:

> Hello,
>
> I have do many tests. It appears that the results of requests
> each time are received in the same order. This order is that of
> creation of the table. If I have make a CREATE TABLE X (int, char,
> int, char), I receive the results of my request SQL in the good order:
> int, char, int, char. However I made only a "select *". I did not
> specify the name of the even put columns nor a "order by". Thus I have
> the impression that I will always receive the results in the order of
> creation of the table when I make a "select *".
>
> Can I in being sure? If it is possible, I would like several
> opinions on the question.
>

why don't you try it? You are in the best position to answer this by 
just carrying out a few tests.

However, as was pointed out in an earlier reply, the only way to be 
really sure is to NOT do a "SELECT * FROM table" but instead use named 
columns as in "SELECT a, b FROM table"

By the way, ORDER BY has nothing to do with the order of the columns. 
It is not quite clear what you are trying to achieve -- a specific 
order of columns or a specific order of the results in the columns. 
Either way, specify what you want and ye shall receive that. Named 
columns will insure the former and ORDER BY will insure the latter.

--
Puneet Kishor


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Reply via email to