I have a table like:
ID word masterWord
1 test 1
1 test1 0
1 test2 0
2 look 0
2 kiss 1
2 eye 0
Now I’d like to get from select statement 2 records with:
test test1, test2
kiss look, eye
First column is master word, second column in group_concat all the other words.
Master words are marked with true (1) in the table and the ID’s are declaration which words holds a group (of synonyms). Ok, I know I’ve made stupid words but I am making this for non English language that has one word has different endings depending on it’s count, gender etc…
Every ID MUST have one word selected as master word… if that helps query or not I don’t know 😉
I think something like
Should do it. Perhaps you might need to add a
CASTto theGROUP_CONCATinput as well.