On Fri, 13 Nov 2009 15:07:54 +0100, Marco Bambini
<[email protected]> wrote:
> sqlite 3.6.19
>
> CREATE TABLE foo (col1 INTEGER PRIMARY KEY, col2 TEXT);
>
> SELECT rowid, col1, col2
>
> returns the following column names with sqlite3_column_name:
> col1, col1, col2
>
> Is there a way to force the first column name to
> be returned as rowid and not as its col1 alias?
CREATE TABLE foo (
col1 INTEGER PRIMARY KEY,
col2 TEXT
);
INSERT INTO foo (col1,col2)
VALUES (1,'row1');
INSERT INTO foo (col1,col2)
VALUES (2,'row2');
.head on
.mode list
SELECT rowid, col1, col2
FROM foo;
col1|col1|col2
1|1|row1
2|2|row2
SELECT rowid AS rowid, col1, col2
FROM foo;
rowid|col1|col2
1|1|row1
2|2|row2
>Thanks.
--
( Kees Nuyt
)
c[_]
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users