In a join, how to prefix all column names with the table it came from

后端 未结 9 1766
你的背包
你的背包 2020-12-08 02:13

I\'m analysing a rather horrible legacy database/codebase, trying to reduce server load by combining queries into joins (including an email alert cron job that typically inv

9条回答
  •  遥遥无期
    2020-12-08 02:45

    @alden-w, You may add TABLE_SCHEMA condition to where to do not mix up same table names from different schemas

    WHERE c.TABLE_SCHEMA='YOUR_SCHEMA_NAME' AND c.TABLE_NAME IN (....)
    

提交回复
热议问题