Syntax Rommel
Syntax Rommel

Reputation: 942

insert all column as 1 column for blob file

Is it possible to direct insert all columns to 1 column for blob file. Or do I need to outfile first the table so that I can upload it as blob. If ever possible here is my imaginary query, something like this:

insert into blob("file") values ('va1','va2','val3')

Any suggestions/comments thanks in advance.

Upvotes: 1

Views: 70

Answers (1)

Richard Hamilton
Richard Hamilton

Reputation: 26444

In mysql, what you're thinking of is concat_ws. This allows you to combine the results from multiple columns.

INSERT INTO mytable(value1)
    SELECT CONCAT_WS(',', value1, value2, value3)
    FROM table
    LIMIT 1;

However, in this case, you don't use the VALUES syntax, you simply run your query.

Here is a fiddle

http://sqlfiddle.com/#!9/57abb/1/0

Upvotes: 1

Related Questions