Reputation: 3
I have a column in my table 'refer'(column) 'chart1'(table) with values 49,47,50 so on for each person Now I have to take these numbers and get details of users with 49,47,50 in other table 'users'
users(table)
Name id address
xxx 49 bnm
yyy 47 kjh
zzz 50 jhg
chart1(table)
Name refer accounts
aaa 49,50 12547
bbb 47,49,50 32546
Now I need to get the details of 'xxx' 'yyy' 'zzz' accordingly by the refer column
Upvotes: 0
Views: 156
Reputation: 6051
Well, if you can, change your database schema. :)
If not, you will have to split the column "refer", see MySQL Split String Function.
Upvotes: 1