Home > Software engineering >  Terminal not displaying all columns of the table in MySQL
Terminal not displaying all columns of the table in MySQL

Time:12-27

under the count column, there is supposed to be integers displayed but instead it is missing. How do i fix this?

example

i did not alter any settings, when i use

SELECT *
FROM TABLES;

there was also some alignment issue.

CodePudding user response:

The treatment column apparently ends with a CR character, which is causing the line to wrap to the beginning, and then it overwrites the count column. Remove that character when displaying the result:

SELECT count, gender, REPLACE(treatment, '\r', '') AS treatment
FROM yourTable

It would probably be best to fix how you load the table so it doesn't include that character in the first place. If you're loading from a CSV file, make sure you use LINES TERMINATED BY '\r\n' instead of LINES TERMINATED BY '\n'.

  • Related