hoverinc Posted January 11, 2011 Share Posted January 11, 2011 HELLO GUYS Please i need help from you, want to select multiple columns from one table and insert it into another table in a single column, is that possible, urgently need help please. Quote Link to comment https://forums.phpfreaks.com/topic/224060-how-to-select-multiple-columns-and-insert-it-into-another-single-column/ Share on other sites More sharing options...
jdavidbakr Posted January 11, 2011 Share Posted January 11, 2011 What do you mean? Perhaps an example of a row in the first table and how you would like it to be inserted into the second table would be helpful. Quote Link to comment https://forums.phpfreaks.com/topic/224060-how-to-select-multiple-columns-and-insert-it-into-another-single-column/#findComment-1157954 Share on other sites More sharing options...
suresh_kamrushi Posted January 12, 2011 Share Posted January 12, 2011 You can try this: Insert into student (id,detail) values(5,(SELECT concat_WS(" - ",id,title,body) FROM `articles` limit 1) ) Quote Link to comment https://forums.phpfreaks.com/topic/224060-how-to-select-multiple-columns-and-insert-it-into-another-single-column/#findComment-1158309 Share on other sites More sharing options...
hoverinc Posted January 17, 2011 Author Share Posted January 17, 2011 Thanks all of you guys, the solution was CONCAT to take values of multi columns and put it in a single column, that was resolved thanks to you. Quote Link to comment https://forums.phpfreaks.com/topic/224060-how-to-select-multiple-columns-and-insert-it-into-another-single-column/#findComment-1160712 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.