tomalex0 — 2010-03-22T07:20:34-04:00 — #1
I'm usinng GROUP_CONCAT to concatinate query results,
eg : SELECT CAST(GROUP_CONCAT(`timestamp` SEPARATOR "','")AS BINARY) as `timestamp`
and it results
2010-03-05 04:38:01[B]','[/B]2010-03-05 04:38:05[B]','[/B]2009-12-24 04:15:49
i like to run above query like this
Select * from demo where demo IN(SELECT CAST(GROUP_CONCAT(`timestamp` SEPARATOR "','"))
if you see the results single quotes is missing from first and last position.
so how can we concatinate single quotes at both ends
Thanks in advance
tomalex0 — 2010-03-22T07:41:27-04:00 — #2
SELECT CONCAT([B]"'",[/B]CAST(GROUP_CONCAT(`timestamp` SEPARATOR "','")AS BINARY)[B],"'"[/B]) as `timestamp`
it works now
tomalex0 — 2010-03-22T08:01:36-04:00 — #3
I have certain doubt my subquery is not working in "IN"
It does not returns any results.
how can i give subquery properly inside "IN"
r937 — 2010-03-22T09:19:09-04:00 — #4
WHERE demo IN ( SELECT `timestamp`
FROM sometable )
tomalex0 — 2010-03-22T10:10:10-04:00 — #5
That was mistake from my side , we dont have to GROUP_CONCAT when using subquery inside "IN"
thanks for the help