Search the Community
Showing results for tags 'where id'.
Found 1 result
Hello, I m a beginner level about writing mysql queries. Shortly and simply my tables are as follows; userTable userid-specs 1-1,2,3 2-10,11 specsTable specid-label 1-football 2-basketball 3-tennis and my query is as follows; SELECT * FROM userTable ut, specsTable st WHERE ut.userid = 1 AND st.specid IN (ut.specs) and it gives me the wrong result like; userid_specs_specid_label 1_1,2,3_1_football where i need an output like this; userid_specs_specid_label 1_1,2,3_1_football 1_1,2,3_2_basketball 1_1,2,3_2_tennis actually output like this would be better (if it can be done) (At the end I m gonna print it like this) [userid:1] can play football,basketball,tennis So my question is, what is it i m missing and it gives me the wrong result? Thank you in advance for your help.