MySQL: how to trim the content of a cell to make SELECT output more readable -
i have mysql table 6 columns. of columns contain long json strings have newlines , spaces. when list content of table select statement, output messy.
is there command (or default setting can change), limit output of each column first few meaningful characters, each row show single line regardless of cell content? like:
+---------------------------+-------------------------+---------+-----------+--------------+----------+ | jsondata | column2 | column3 | column4 | column5 | column6 | +---------------------------+-------------------------+---------+-----------+--------------+----------+ | { "text":[{"user_id":"3","| abcdefabcdefabcdefabc | 3 | abcabca | txt | { "email"| +---------------------------+-------------------------+---------+-----------+--------------+----------+
i don't know settings can permanently change in db, should format output describe it:
select column2, column3, column4, column5, replace(cast(jsondata char(20)), '\n', '') jsondata tablename;
Comments
Post a Comment