I applaud your efforts to learn SQL.  

I wonder, though, if the PHP-DB list the best place to learn SQL.  I would
think that a book or a web-based tutorial on SQL would be more conducive to
your efforts.

In the example you have given below, you would probably want to use LIKE.
For example, "SELECT * FROM test WHERE cat LIKE '%c%';" or similar ought to
do it.  Of course, I hope that the example is merely an example because if
you really designed a production table like that then you wouldn't be
taking advantage of the "relational" part of your relational database
management system.

So please keep learning SQL...it's a fantastic skill to have.  If you have
a specific SQL problem every once in a while there are those on this list
who would undoubtedly enjoy helping out.  Several beginner-level questions
back-to-back, though, is way beyond the charter of this mailing list.  The
overall purpose of this particular mailing list is for discussions about
PHP's ability to interface with databases.  There may possibly be an SQL
beginners mailing list on egroups or someplace similar...you might find an
environment like that better than the PHP-DB list to help you with this stuff.


At 02:56 PM 7/16/01 -0400, McShen wrote:
>ok. I use set to make a table. here is my table 'test'
>| name  | cat  |
>| shen  | a,c  |
>| shen1 | b,c  |
>How can I find all records that contain 'c'?
>i tried
>select * from test where cat='c';

PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to