Hi,
Please help me, i try to fetch category list as like below, where category ids is passed in inclause, it returns two rows.
mysql> select c_id,c_name from category where c_id in (870,854);
+------+---------------+
| c_id | c_name |
+------+---------------+
| 854 | Telugu |
| 870 | Telugu Events |
+------+---------------+
Whereas same category id is concatenated and passed to inclause as parameter, but its returning only one row insted of two rows.
mysql> select c_id,c_name from category where c_id in (select concat(870,',',854) as c_id);
+------+---------------+
| c_id | c_name |
+------+---------------+
| 870 | Telugu Events |
+------+---------------+
Please clarigy me.
Thanks.
s.ganesh 0 Newbie Poster
pritaeas 2,194 ¯\_(ツ)_/¯ Moderator Featured Poster
s.ganesh 0 Newbie Poster
pritaeas 2,194 ¯\_(ツ)_/¯ Moderator Featured Poster
cereal commented: +1 +13
s.ganesh 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.