MySQL Forums
Forum List  »  Newbie

INSERT from SELECT into a variable
Posted by: Jassm Rahma
Date: May 16, 2016 04:08AM

Hi,

In MySQL, I have basket field call item_name in my order_basket table.

I want an SQL statement to take all item_name and INSERT it into a variable call param_details which is a TEXT variable with a "\n" between them.

something like this

DECLARE param_details text;

INSERT CONTACT(item_name, "\n" INTO param_details FROM order_basket

So basically I need one variable to have the data (like one cell only).

Hope I explained it well...

How can I do this please?


Thanks,
Jassim

Options: ReplyQuote


Subject
Written By
Posted
INSERT from SELECT into a variable
May 16, 2016 04:08AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.