Sample Header Ad - 728x90

In MySQL query, VARCHAR(100) gets output as "[partnumber]" although in a query with more columns, it is still shown as 'p-12345'

-1 votes
1 answer
427 views
**This is a bad question since I only made a mistake in selecting by chance a client that had garbage data and must have changed the where condition during tests, and it was also a problem of a join that I did not even mention in the question that led to so many of the strange [partnumber] entries that the limit 10 query showed *only* those. So that I thought the whole column would have this value. I am not sure whether I should delete it. It might also help someone else who has garbage data without knowing about it. You may vote to close the question if you think it has wasted your time. For I see myself that this can be a waste of time reading.** In a normal SELECT p.* FROM table query with many columns, the output shows values in a needed column, every number shows up, showing the column with the partnumber (a partially numeric number like p-12345) only: enter image description here But when I ask for only that column alone with SELECT client_x FROM table, I get: enter image description here ## UPDATE: I can see the values of that column now!! They are not showing [partnumber] anymore in each row, but instead, there are numbers and strings and empty values as well in it. enter image description here I had the where condition on the client in it, and the value in that client is always [partnumber]. It is garbage only in that client. ## UPDATE end The column data type is varchar(100). It should be treated as a normal string. enter image description here I use DBeaver, but that should not play a role. If I concatenate the column with some string, the value appears as an empty string: SELECT CONCAT("test", client_x) FROM table returns just "test" as values. How can I avoid this [partnumber] output in the column output and show the part number string instead, like it is shown when I just run SELECT * FROM table?
Asked by questionto42 (366 rep)
Mar 12, 2022, 12:00 AM
Last activity: Mar 14, 2022, 12:15 PM