0

I need to select all columns of table:

SELECT * FROM table_name 

is there any way to trim all values without naming one by one like this ?

SELECT TRIM(*) FROM table_name 
alex
  • 7,551
  • 13
  • 48
  • 80
  • Does this answer your question? [Mysql:Trim all fields in database](https://stackoverflow.com/questions/6072197/mysqltrim-all-fields-in-database) – Toni Feb 19 '21 at 05:25
  • @Toni that answer seems to update table each time a request is peformed. that i dont need that. – alex Feb 19 '21 at 06:49
  • Why are you storing untrimmed data? – Strawberry Feb 19 '21 at 08:15
  • Anyway, you just have to name (and trim) each column, which is what you should be doing anyway. – Strawberry Feb 19 '21 at 08:16
  • @Strawberry I'm storing data through phpmyadmin. is there any function that trim data before storing automatically? – alex Feb 19 '21 at 08:29
  • I don't use phpmyadmin, so I wouldn't know. I normally submit data to a database via a bit of application code (php, in my case), which will do all the tidying up. – Strawberry Feb 19 '21 at 08:31
  • ' I'm storing data through phpmyadmin' - doesn't mean much, are you using load data infile, importing using import wizard, inserting... – P.Salmon Feb 19 '21 at 08:42
  • @P.Salmon I'm using insert – alex Feb 19 '21 at 17:27

0 Answers0