Hi Smart People,
Here is my puzzle ....
I would like to store an array of comma separated numbers in a user table, and then use this array of numbers to SELECT ALL IN another table.
Example:
Table:USERS
id = [6 ]| favorites = [1,2,4,5,]
Table: FAVORITES
id = [1] | fav = [DOGS]
id = [2] | fav = [CATS]
id = [3] | fav = [FISHS]
id = [4] | fav = [PAROTS]
id = [5] | fav = [MONKEYS]
id = [6] | fav = [HORSES]
id = [7] | fav = [SHEEP]
Desired RESULT =
USER 6 likes DOGS,CATS,PARROTS,MONKEYS
Is this Possible?
Can someone help me with the correct way to write this SQL statement?
Can this be a stored Procedure?
All help gratefully received.
Coddie
Here is my puzzle ....
I would like to store an array of comma separated numbers in a user table, and then use this array of numbers to SELECT ALL IN another table.
Example:
Table:USERS
id = [6 ]| favorites = [1,2,4,5,]
Table: FAVORITES
id = [1] | fav = [DOGS]
id = [2] | fav = [CATS]
id = [3] | fav = [FISHS]
id = [4] | fav = [PAROTS]
id = [5] | fav = [MONKEYS]
id = [6] | fav = [HORSES]
id = [7] | fav = [SHEEP]
Desired RESULT =
USER 6 likes DOGS,CATS,PARROTS,MONKEYS
Is this Possible?
Can someone help me with the correct way to write this SQL statement?
Can this be a stored Procedure?
All help gratefully received.
Coddie