[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sqlite-users
Subject:    Re: [sqlite] Column names in SQL
From:       P Kishor <punk.kish () gmail ! com>
Date:       2010-06-28 15:19:06
Message-ID: AANLkTikLuKEuzAzE1phW56ekYtI8P5PjB93At31Rz_W2 () mail ! gmail ! com
[Download RAW message or body]

On Mon, Jun 28, 2010 at 10:07 AM, Serdar Genc <serdar.genc@gmail.com> wrote:
> I have already tried it but not working.. :(
>

Works for me.

punkish@Lucknow ~$sqlite3
-- Loading resources from /Users/punkish/.sqliterc
SQLite version 3.6.23
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> CREATE TABLE t ("a[b]");
sqlite> INSERT INTO t VALUES ('foo');
sqlite> INSERT INTO t VALUES (3);
sqlite> SELECT * FROM t;
a[b]
----------
foo
3
sqlite> SELECT "a[b]" FROM t WHERE "a[b]" = 3;
a[b]
----------
3
sqlite>

You are doing something else. You are not describing the entire
problem. How are you accessing your database?


> On Mon, Jun 28, 2010 at 6:01 PM, P Kishor <punk.kish@gmail.com> wrote:
>
>> On Mon, Jun 28, 2010 at 9:58 AM, Serdar Genc <serdar.genc@gmail.com>
>> wrote:
>> > Hi everyone,
>> >
>> > I have a problem related to column names . I have a column name as a[b]
>> in
>> > my table but
>> > this creates a problem when using SELECT statement as
>> > SELECT a[b] from Table. I know [] is a special character but How would I
>> > tell SQlite that field
>> > name is a[b] and I am not using [] with a special purpose..
>>
>> Try SELECT "a[b]"
>>
>>
>> >
>> > Thanks in advance,
>> > Serdar
>> > _______________________________________________
>> > sqlite-users mailing list
>> > sqlite-users@sqlite.org
>> > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>> >
>>
>>
>>
>> --
>> Puneet Kishor http://www.punkish.org
>> Carbon Model http://carbonmodel.org
>> Charter Member, Open Source Geospatial Foundation http://www.osgeo.org
>> Science Commons Fellow, http://sciencecommons.org/about/whoweare/kishor
>> Nelson Institute, UW-Madison http://www.nelson.wisc.edu
>> -----------------------------------------------------------------------
>> Assertions are politics; backing up assertions with evidence is science
>> =======================================================================
>> _______________________________________________
>> sqlite-users mailing list
>> sqlite-users@sqlite.org
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>>
>
>
>
> --
>
> Serdar Genç
> web: http://www.iptakip.com
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
Puneet Kishor http://www.punkish.org
Carbon Model http://carbonmodel.org
Charter Member, Open Source Geospatial Foundation http://www.osgeo.org
Science Commons Fellow, http://sciencecommons.org/about/whoweare/kishor
Nelson Institute, UW-Madison http://www.nelson.wisc.edu
-----------------------------------------------------------------------
Assertions are politics; backing up assertions with evidence is science
=======================================================================
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic