How does mysql query a field name whose value is a certain number?

for example, suppose that in a database test1, a table is called test2, field name A _ Magi B _ ~ C _ D _ D ~ E, and the value is 0 or 1.
then how to query the names of fields with a value of 1 in each row of data?

Mar.10,2021

SELECT id, CONCAT(
    CASE WHEN A=1 THEN 'A ' ELSE '' END,
    CASE WHEN B=1 THEN 'B ' ELSE '' END,
    CASE WHEN C=1 THEN 'C ' ELSE '' END,
    CASE WHEN D=1 THEN 'D ' ELSE '' END,
    CASE WHEN E=1 THEN 'E ' ELSE '' END)
FROM test2

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-1b37c0b-e60b.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-1b37c0b-e60b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?