On Mon, Dec 14, 2015 at 11:21 AM, ??? <2004wqg2008 at 163.com> wrote:

> hi, every one.
>      Here is a very strange and interesting problem.
>      I used the following SQL to create the table teacher.
>      CREATE TABLE techer(poiId INTEGER NOT NULL PRIMARY KEY,
>                                             versionId INTEGER NOT NULL,
>                                             regionId INTEGER ,
>                                             postalCode TEXT ,
>                                             phone TEXT ,
>                                             attrBitMask INTEGER ,
>                                             attributeBlob BLOB)
>
>      and  then I used the following SQL,
>      select rowid,*  from teacher.    So the strange and interesting
> problem happen.
>      the name of the rowid column change to poiId, and the name of the
> poiId become poiId_1. But the two columns have the same values.
>
>      Why the rowid change is column name?
>      Is the problem reasonable ?  How do you think about this problem? why?
>      I  am looking forward to hearing from you.
>

Two answers come to mind:

1) if you do not alias column names using "AS" then the name you get from
the db driver is UNDEFINED. It might call all of them "foo" and still be
legal. The ONLY way to guaranty the names is to use "AS" to give them an
explicit name.

2) i'm guessing that you are using an abstraction layer which is changing
the returned name of your rowid.


-- 
----- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
"Freedom is sloppy. But since tyranny's the only guaranteed byproduct of
those who insist on a perfect world, freedom will have to do." -- Bigby Wolf

Reply via email to