'word' is correct SQL, "word" is not.

Matteo Vescovi wrote:
Hi,
I am getting weird results when executing a query that
has this WHERE clause: WHERE word = "word".

The query works fine if I use WHERE word = 'word'.

The following illustrates the problem:

[EMAIL PROTECTED]:~$ sqlite -version
2.8.17
[EMAIL PROTECTED]:~$ cat populate.sql
CREATE TABLE _1_gram (word TEXT, count INTEGER,
UNIQUE(word) );
INSERT INTO _1_gram VALUES("foo", 13);
INSERT INTO _1_gram VALUES("bar", 16);
INSERT INTO _1_gram VALUES("word", 36);
INSERT INTO _1_gram VALUES("foobar", 336);
[EMAIL PROTECTED]:~$ sqlite test.db < populate.sql
[EMAIL PROTECTED]:~$ sqlite test.db
SQLite version 2.8.17
Enter ".help" for instructions
sqlite> SELECT * FROM _1_gram WHERE word = 'word';
word|36
sqlite> SELECT * FROM _1_gram WHERE word = "word";
foo|13
bar|16
word|36
foobar|336
sqlite> .quit
[EMAIL PROTECTED]:~$

Am I missing something here (I haven't used SQL in a
while...), or is this a bug?

Cheers,
- Matteo Vescovi



                
___________________________________________________________ All New Yahoo! Mail – Tired of unwanted email come-ons? Let our SpamGuard protect you. http://uk.docs.yahoo.com/nowyoucan.html

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------



-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to