开发者

how to get dump of column in mysql>

开发者 https://www.devze.com 2023-03-27 20:30 出处:网络
I want to have dump of column like var_dump in php. For eg: select dump(col_name)from table_name o/p => Typ=96 Len=10: 113,119,101,114,116,121,32,32,32,32

I want to have dump of column like var_dump in php.

For eg:

select dump(col_name) from table_name

o/p =>

Typ=96 Len=10: 113,119,101,114,116,121,32,32,32,32

but开发者_开发技巧 it says such function does not exists. which function in,mysql does that or how to go for it


You can use GROUP_CONCAT to get list of values separated by comma:

SELECT GROUP_CONCAT(col_name SEPARATOR ',') ...

Note. The result of GROUP_CONCAT depends on max_allowed_packet and group_concat_max_len variables; if you have many records in your table, you need to increase default values (SET group_concat_max_len = xxxx);

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号