From 2d71af9efbf5ea4204dbf15939aae29927312cc8 Mon Sep 17 00:00:00 2001 From: Charles7c Date: Fri, 10 Mar 2023 23:17:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=EF=BC=9A=E4=BC=98=E5=8C=96?= =?UTF-8?q?=20SQL=20=E8=AF=AD=E5=8F=A5=E9=A3=8E=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1.MySQL数据库>SQL语句>第10条: 【推荐】SQL 语句中表的别名前加 as,并且以 t1、t2、t3、...的顺序依次命名。 说明: 1)别名可以是表的简称,或者是依照表在 SQL 语句中出现的顺序,以 t1、t2、t3 的方式命名。 2)别名前加 as 使别名更容易识别。 正例:select t1.name from first_table as t1 , second_table as t2 where t1.id = t2.id 个人理解:使用 t1、t2、t3... 的表别名命名方式,在很多类似业务查询的场景会更方便复用;使用 AS 而不是 as 更容易阅读。 --- .../src/main/resources/mapper/MenuMapper.xml | 38 +++++++++---------- .../main/resources/mapper/RoleMenuMapper.xml | 13 +++---- 2 files changed, 24 insertions(+), 27 deletions(-) diff --git a/continew-admin-system/src/main/resources/mapper/MenuMapper.xml b/continew-admin-system/src/main/resources/mapper/MenuMapper.xml index 7738d222..4949d661 100644 --- a/continew-admin-system/src/main/resources/mapper/MenuMapper.xml +++ b/continew-admin-system/src/main/resources/mapper/MenuMapper.xml @@ -2,27 +2,27 @@ \ No newline at end of file diff --git a/continew-admin-system/src/main/resources/mapper/RoleMenuMapper.xml b/continew-admin-system/src/main/resources/mapper/RoleMenuMapper.xml index c5788a87..a3b902e0 100644 --- a/continew-admin-system/src/main/resources/mapper/RoleMenuMapper.xml +++ b/continew-admin-system/src/main/resources/mapper/RoleMenuMapper.xml @@ -2,14 +2,11 @@ \ No newline at end of file