Timeline for Not getting the expected result with 'IN' and subquery
Current License: CC BY-SA 3.0
17 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
May 1, 2013 at 13:36 | answer | added | ypercubeᵀᴹ | timeline score: 2 | |
S May 1, 2013 at 12:01 | history | suggested | altmannmarcelo |
added subquery tag
|
|
May 1, 2013 at 11:55 | vote | accept | jogesh_pi | ||
May 1, 2013 at 11:55 | vote | accept | jogesh_pi | ||
May 1, 2013 at 11:55 | |||||
May 1, 2013 at 11:21 | answer | added | jap1968 | timeline score: 2 | |
May 1, 2013 at 11:19 | review | Suggested edits | |||
S May 1, 2013 at 12:01 | |||||
May 1, 2013 at 11:18 | answer | added | user23243 | timeline score: 3 | |
May 1, 2013 at 11:09 | comment | added | jogesh_pi | @Mat is there some alternative solution or i have to change the datatype? | |
May 1, 2013 at 11:07 | comment | added | jogesh_pi |
@Mark tbl_destinations's id has datatype INT .
|
|
May 1, 2013 at 11:06 | comment | added | user23243 | is tbl_destinations's id numeric or text? | |
May 1, 2013 at 11:05 | comment | added | Mat |
Yes, and that's exactly your problem. That column should have the same datatype as that of tlb_destinations.id , and not contain strings of any sort.
|
|
May 1, 2013 at 11:03 | comment | added | jogesh_pi |
@Mat in tbl_rings_to_groups there is a field named destinations has the comma separated ID's of table tbl_destinations . And in above subquery return only id 1 not like 1,3
|
|
May 1, 2013 at 11:01 | comment | added | Mat |
"why i didn't get the destinations=>1,3 " - in fact, you did. But there is certainly no destination with an id of '1,3' in your database. You should fix your schema, not that query.
|
|
May 1, 2013 at 10:53 | comment | added | jogesh_pi | @Mark i have updated my question please take a look.. | |
May 1, 2013 at 10:52 | history | edited | jogesh_pi | CC BY-SA 3.0 |
added 226 characters in body
|
May 1, 2013 at 10:49 | comment | added | user23243 | More details needed, add a few sample records for tbl_rings_to_groups and tbl_destinations. | |
May 1, 2013 at 10:43 | history | asked | jogesh_pi | CC BY-SA 3.0 |