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';

it returned "empty set";

please help


"Tom Hodder" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> First normal form (1NF), A table in which the intersection of every column
> and record contains one, and only one, value.
>
>
>
> -----Original Message-----
> From: Hugh Bothwell [mailto:[EMAIL PROTECTED]]
> Sent: 16 July 2001 19:21
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] Re: enum !!
>
>
>
> "McShen" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > how do i store multiple data in one field?
> > i have a table like this
> >
> > +-------+-------------------+------+-----+---------+-------+
> > | Field | Type              | Null | Key | Default | Extra |
> > +-------+-------------------+------+-----+---------+-------+
> > | test  | enum('a','b','c') | YES  |     | NULL    |       |
> > +-------+-------------------+------+-----+---------+-------+
> >
> > insert into test values('a','b','c');  doens't work. please help
>
> Your query is mixed up; 'test' is the field name, not the table name, and
I
> think you want to put the values into three separate records, not one...
>
> Try
> INSERT INTO tablename ( test ) VALUES ( 'a' ), ( 'b'), ('c'), ('');
>
> This should get you four records, with 'test' values of a, b, c, and null.
>
> If you want to store more than one value in the same record, you should be
> looking at sets, not enums.
>
>
>
> --
> 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]
>
>



-- 
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