tobeyt23 Posted January 13, 2009 Share Posted January 13, 2009 I have a table: id submission_id field_id data 1 1 1 First Name 2 1 2 Last Name Can I do one select statment and get all the field_ids combined into one column and the same for the data column? Quote Link to comment https://forums.phpfreaks.com/topic/140713-can-this-be-done/ Share on other sites More sharing options...
rhodesa Posted January 13, 2009 Share Posted January 13, 2009 if i understand what you are asking...no Quote Link to comment https://forums.phpfreaks.com/topic/140713-can-this-be-done/#findComment-736535 Share on other sites More sharing options...
fenway Posted January 14, 2009 Share Posted January 14, 2009 Not sure what you're asking... but probably yes under certain circumstances. Please provide desired sample output. Quote Link to comment https://forums.phpfreaks.com/topic/140713-can-this-be-done/#findComment-736885 Share on other sites More sharing options...
aschk Posted January 14, 2009 Share Posted January 14, 2009 Yes but you need to decide how you're grouping those rows. i.e. SELECT GROUP_CONCAT(field_id SEPARATOR ',') ,GROUP_CONCAT(data SEPARATOR ',') FROM <table name here> GROUP submission_id Quote Link to comment https://forums.phpfreaks.com/topic/140713-can-this-be-done/#findComment-736909 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.