我留下了一些看起来像这样的代码:
SELECT DISTINCT ee.* FROM exp_extensions ee WHERE enabled = 'y'
我们的数据库管理员对全选大喊大叫,并希望我们分别获取所有单独的字段。我以前从未见过SELECT DISTINCT *
;我将如何重写它?
选项1:
SELECT DISTINCT ee.extension_id, ee.class, ee.method, ee.hook, ee.settings, ee.priority, ee.version, ee.enabled FROM exp_extensions ee WHERE enabled = 'y'
选项 2:
SELECT DISTINCT (ee.extension_id, ee.class, ee.method, ee.hook, ee.settings, ee.priority, ee.version, ee.enabled) FROM exp_extensions ee WHERE enabled = 'y'
或者完全是其他方式?