[英]How do I get the table names prefixing the column names automatically for the output data of my sql query?
我有一个select *
多个表,并希望用表名作为列名的前缀(因为有些表具有相同名称的列)。 我该怎么做呢?
使用别名:
SELECT t1.c1 AS t1_c1
, t2.c1 AS t2_c1
FROM t1 JOIN t2 ON t1.a = t2.b;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.