Hi
I have a table that stores personal informations. Personal infos have a field of vehicle type in which user can select multiple vehicles from multiselect dropdown list.
So I have to store selected dropdown item(Multiple ids) in a single column of table(Column Name say RelatedVehicles and the values stored the column in my case is 1,29 in nvarchar(200) type column).
Now I have to fetch this value(1,29) which nvarchar type to 'In' clause of another query like below:
select * from VehicleMaster where vId in (Select RelatedVehicles from UserMaster where UID=1).
Here vId in of Integer type and subquery returns nvarchar type value i.e ('1,29') .
Please suggest...
I have tried replacing the (,) to ',' so it becomes '1','29' now then it is not accepting it.
Laxmidhar SahooRank #383 · 6.6K reputationPosted Nov 18, 2018, 4:44 PM EST
Amit GuptaRank #190 · 12.8K reputationPosted Nov 16, 2018, 11:36 PM EST
Laxmidhar SahooRank #383 · 6.6K reputationPosted Nov 17, 2018, 2:16 AM EST
Jignesh KumarRank #91 · 22.9K reputationPosted Nov 17, 2018, 3:24 AM EST
Jignesh KumarRank #91 · 22.9K reputationPosted Nov 19, 2018, 5:10 PM EST
Sourav MukherjeeRank #850 · 2.6K reputationPosted Dec 6, 2018, 11:23 AM EST
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsTop experts