On Fri, Apr 30, 2010 at 9:53 AM, ecforu <ecforus...@gmail.com> wrote:

> I don't think it is a case issue.  See below from sqlite3 command line.
> Also one thing to note - I build the database from c API.  I don't know if
> that makes a difference.
>
>
Please email me your database file by private email and I will have a look.


> sqlite>
> sqlite> select timeStamp, resourceType From MyTable where resourceType like
> 'PSM' LIMIT 10;
> timeStamp|resourceType
> 2010-04-28 17:46:45.316|PSM
> 2010-04-28 17:46:49.854|PSM
> 2010-04-28 17:46:52.830|PSM
> 2010-04-28 17:47:04.939|PSM
> 2010-04-28 17:47:06.776|PSM
> 2010-04-28 17:47:08.846|PSM
> 2010-04-28 17:47:12.001|PSM
> 2010-04-28 17:47:13.845|PSM
> 2010-04-28 17:47:16.837|PSM
> 2010-04-28 17:47:18.846|PSM
> sqlite>
> sqlite>
> sqlite> select timeStamp, resourceType From MyTable where resourceType =
> 'PSM' LIMIT 10;
> sqlite>
> sqlite>
> sqlite>
>
> THANKS
>
>
> On Fri, Apr 30, 2010 at 9:35 AM, Black, Michael (IS) <
> michael.bla...@ngc.com
> > wrote:
>
> > You are likely getting the case insensitive result with "like".
> >
> > sqlite> create table t(resourceType varchar);
> > sqlite> insert into t values('PSM');
> > sqlite> insert into t values('psm');
> > sqlite> select * from t where resourceType = 'PSM';
> > PSM
> > sqlite> select * from t where resourceType like 'PSM';
> > PSM
> > psm
> > sqlite> select * from t where upper(resourceType) = 'PSM';
> > PSM
> > psm
> >
> > Michael D. Black
> > Senior Scientist
> > Northrop Grumman Mission Systems
> >
> >
> > ________________________________
> >
> > From: sqlite-users-boun...@sqlite.org on behalf of ecforu
> > Sent: Fri 4/30/2010 8:31 AM
> > To: General Discussion of SQLite Database
> > Subject: Re: [sqlite] WHERE = does not work
> >
> >
> >
> > But the like WHERE clause works the way it is.  Its the = that isn't
> > working.  I would rather use = than like.  I'm just using like for now
> > because it works.
> >
> > Thanks
> >
> > On Fri, Apr 30, 2010 at 9:29 AM, Timothy A. Sawyer <
> > tsaw...@mybowlingdiary.com> wrote:
> >
> > > With the like clause you have to use the % sign as a wildcard. So
> > > resourceType LIKE %'PSM' returns anything ending in PSM. The SQLite
> > website
> > > has excellent docs on standard SQL.
> > >
> > > -----Original Message-----
> > > From: ecforu <ecforus...@gmail.com>
> > > Sent: Friday, April 30, 2010 09:22
> > > To: sqlite-users@sqlite.org
> > > Subject: [sqlite] WHERE = does not work
> > >
> > > I have an sqlite3 database which I can't query with WHERE =.  I have to
> > use
> > > WHERE like.
> > >
> > > Any ideas why this is?
> > >
> > > For example I have a resourceType column that has as some of its
> entries
> > > (over 50) 'PSM'.
> > >
> > > SELECT * FROM MyTable WHERE resourceType = 'PSM'  --> returns nothing.
> > >
> > > SELECT * FROM MyTable WHERE resourceType like 'PSM' --> returns all PSM
> > > entries.
> > >
> > > What's the diff?
> > >
> > > Thanks
> > > _______________________________________________
> > > sqlite-users mailing list
> > > sqlite-users@sqlite.org
> > > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> > >
> > > _______________________________________________
> > > sqlite-users mailing list
> > > sqlite-users@sqlite.org
> > > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> > >
> > _______________________________________________
> > sqlite-users mailing list
> > sqlite-users@sqlite.org
> > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> >
> >
> >
> > _______________________________________________
> > sqlite-users mailing list
> > sqlite-users@sqlite.org
> > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> >
> >
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
---------------------
D. Richard Hipp
d...@sqlite.org
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to