kozz
kozz

Reputation: 11

MYSQL STORED PROCEDURE with OUTFILE with no spaces in txt file

I would like to export a query result in a txt file, but with no field separators

like this: field1field2field3field4

if I use the fields terminated by and optionally enclosed by and set them to '', I still get some kind of tabs between fields...

How can I get the output right?

thanks in advance...

Upvotes: 1

Views: 608

Answers (1)

Brian Hooper
Brian Hooper

Reputation: 22084

Could you try something like...

SELECT field1 || field2 || field3 AS answer
    FROM mytable;

Or if your query is not something you want to fiddle with too much,

SELECT field1 || field2 || field3 AS answer
    FROM (other query in here) AS mytable;

Upvotes: 1

Related Questions