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? 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 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. 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 Link to comment https://forums.phpfreaks.com/topic/140713-can-this-be-done/#findComment-736909 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.