View Single Post
  #22 (permalink)  
Old 08-03-2007, 12:49 PM
Murali Murali is offline
D-Web Master
 
Join Date: Feb 2007
Location: India-Chennai.
Posts: 386
Murali is on a distinguished road
Send a message via AIM to Murali
Default Re: Use on group_concat

Quote:
Originally Posted by priyan View Post
Hi Murali,
Generaly group_concat functions returns the result in blob format. It seems like like toad error / may not a error also. Anyway, if you want to view the result set in toad using group_concat function means use CAST function and convert the group concat result set into binary.

Eg..
SELECT CAST(group_concat(emp_id) AS BINARY) FROM emp_master;
Hi Priyan,

Found a new one, check this out.

In MYSQL

mysql> SELECT myfield FROM test_cast;
Quote:
myfield
123
456
abcd
03 rows in set (0.00 sec)
SELECT CAST(GROUP_CONCAT(myfield)AS BINARY) FROM test_cast;
Quote:
Output: 123,456,abcd

In ORACLE


SELECT CAST('123'AS INTEGER) AS VAL FROM DUAL;
Quote:
Output:
VAL
----------
123
1 row selected.
SELECT CAST('123,ABCD'AS INTEGER) AS VAL FROM DUAL;

Quote:
Output:
ORA-01722: invalid number
Seems to be CAST Functionality differs with using GROUP_CONCAT() Function in MYSQL.
__________________
-Murali..
Reply With Quote