سؤال

Is there a way to use GROUP_CONCAT in the DESCRIBE table query? Was hoping for output like:

id,title,body

Rather than the typical description...

هل كانت مفيدة؟

المحلول

This should do the trick:

SELECT 
    GROUP_CONCAT(COLUMN_NAME) 
FROM INFORMATION_SCHEMA.COLUMNS 
WHERE
    TABLE_SCHEMA=DATABASE() 
AND TABLE_NAME='your-table-name';
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top