Link to home
Start Free TrialLog in
Avatar of darence
darence

asked on

Question - Comma as seperator?

Hi!
I would like to knoe if anyone knoes if i have a coloum name called Interest where people can key in different things, how am i gona differentiate it?
Like my interest is play games , soccer , basketball , singing...

How am i gona seperate like soccer into an individual interest ?

Can we like use comma?

Also... if we use coma, when we do our select statement...
how shall we go bout doin it?

Please advice
Avatar of aoreshkova
aoreshkova

It's not very clear what you really want. Do you want to filter records on some intrests (like every users that have interest soccer)?
ASKER CERTIFIED SOLUTION
Avatar of aoreshkova
aoreshkova

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You want rows, not comma sepearted values

CREATE TABLE myInterests99(UserId varchar(8), Interest varchar(25))
GO

INSERT INTO myInterests99(UserId,Interest)
SELECT 'X002548','Skiing' UNION ALL
SELECT 'X002548','Hockey' UNION ALL
SELECT 'X002548','Tennis' UNION ALL
SELECT 'X002548','Margarittas'


Avatar of darence

ASKER

Dear aoreshkova..
yes!
Thats wat i m looking for..
like select * who like soccer!
:)

DOes that means my select statement need to use LIKE '%soccer%'
what does % means?

X002548... i will try out ur method!
:)