I have a table with 4 records:
NAME INSTRUMENT BOOLEAN 1 BOOLEAN 2
Bob Organ TRUE FALSE
Thomas Violin FALSE FALSE
Bob Piano FALSE TRUE
I want to merge records with same “NAME”, in order to get :
Bob Organ Piano TRUE TRUE
Thomas Violin FALSE FALSE
What’s the rule that I want when merging ?
-
“text fields” are just concatenated (example : Organ + Piano ==> “Organ Piano”)
-
“boolean fields” are merged with a LOGICAL OR (example : TRUE or FALSE = TRUE)
My questions :
1) I will choose which software to use in regard to the ability to do this! Database with SQL queries (SQLite, MySQL or even Access) or Excel ?
2) If the best solution is a database, what’s the SQL query to do that ?
Thanks a lot in advance!
My choes and SQLServer2005+
Example on SQLFiddle