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
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e455ce-44b48.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e455ce-44b48.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?