{"id":964,"date":"2017-10-12T21:12:42","date_gmt":"2017-10-12T21:12:42","guid":{"rendered":"http:\/\/blog.silverterra.net\/?p=964"},"modified":"2017-10-12T21:14:18","modified_gmt":"2017-10-12T21:14:18","slug":"table-column-names-comma-delimited-list","status":"publish","type":"post","link":"http:\/\/blog.silverterra.net\/?p=964","title":{"rendered":"Table column names comma delimited list"},"content":{"rendered":"<blockquote><p>Goal: quick method to get the column names comma delimited list<\/p><\/blockquote>\n<p>Simple mysql or mariadb database. How to get a detailed select command if I don&#8217;t have a good sql gui tool. So, here is an easy way:<\/p>\n<pre data-enlighter-language=\"sql\" class=\"EnlighterJSRAW\">\r\nselect GROUP_CONCAT(COLUMN_NAME)\r\n  from INFORMATION_SCHEMA.COLUMNS\r\n WHERE TABLE_SCHEMA = 'INFORMATION_SCHEMA'\r\n   AND TABLE_NAME = 'files';\r\n<\/pre>\n<p>where TABLE_SCHEMA is your schema, and TABLE_NAME is the table in the question.<br \/>\nThe result will be like&#8230;<\/p>\n<pre data-enlighter-language=\"sql\" class=\"EnlighterJSRAW\">\r\nFILE_ID,FILE_NAME,FILE_TYPE,TABLESPACE_NAME,...\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Goal: quick method to get the column names comma delimited list Simple mysql or mariadb database. How to get a detailed select command if I don&#8217;t have a good sql gui tool. So, here is an easy way: where TABLE_SCHEMA is your schema, and TABLE_NAME is the table in the question. The result will be [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-964","post","type-post","status-publish","format-standard","hentry","category-mysql"],"_links":{"self":[{"href":"http:\/\/blog.silverterra.net\/index.php?rest_route=\/wp\/v2\/posts\/964","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/blog.silverterra.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.silverterra.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.silverterra.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.silverterra.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=964"}],"version-history":[{"count":3,"href":"http:\/\/blog.silverterra.net\/index.php?rest_route=\/wp\/v2\/posts\/964\/revisions"}],"predecessor-version":[{"id":967,"href":"http:\/\/blog.silverterra.net\/index.php?rest_route=\/wp\/v2\/posts\/964\/revisions\/967"}],"wp:attachment":[{"href":"http:\/\/blog.silverterra.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=964"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.silverterra.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=964"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.silverterra.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=964"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}