[thelist] A SQL request on a SET() field type

rudy r937 at interlog.com
Mon Jul 23 07:03:46 CDT 2001


> Select * from mytable where mysetfield = 'UK';
> works if mysetfield is ('UK')
> doesn't work if mysetfield is for example: ('UK', 'FR')

hi damien

if it's more than one, use IN

    Select * from mytable where mysetfield in ('UK', 'FR')

<tip>
if you're not sure whether you will be testing against one or more values,
use IN anyway
    Select * from mytable where mysetfield in ('UK')
</tip>


>What is the secret of the SET type ?

not sure what secret you're after, but what usually trips people up
is that you can only use the SET keyword once --

   update yourTable
     set foo='a'
        , bar='b'
        , quux = 3

rudy






More information about the thelist mailing list