Find a section of sql

< table > < thead > < tr > < th > now the query result in mysql has the following columns. You want it to output "adv.". Choose between the two, otherwise, or "how do you write this sql? < / th > < / tr > < / thead > < tbody > < tr > < td > pid < / td > < td > ID < / td > < td > pos < / td > < td > cn < / td > < / tr > < tr > < td > 890 < / td > < td > 305 < / td > < td > adv. < / td > < td > choose between the two < / td > < / tr > < tr > < td > 891 < / td > < td > 305 < / td > < td > adv. < / td > < td > otherwise < / td > < / tr > < tr > < td > 892 < / td > < td > 305 < / td > < td > adv. < / td > < td > or < / td > < / tr > < / tbody > < / table >
Aug.02,2021

the description of the problem is vague, and I can only guess that it is grouped by pos, with the values of the cn fields in each group concatenated and separated by commas.

if this is the case, you can use group_concat, for example:

select pos, group_concat(cn) from t group by pos
Menu