示例表 1:
id | field1 | field2
--------------------
表2:
id | id1 | field1 | field2
--------------------------
是否有可能做到这一点:
select t1.*, t2.* from table1 t1 inner join table2 t2 on t1.id = t2.id1
并收到这个结果:
t1_id | t1_fiedl1 | t1_field2 | t2_id | t2_id1 | t2_fiedl1 | t2_field2
----------------------------------------------------------------------
目标是让 mysql 自动为结果字段添加前缀,以避免长时间输入,例如
select t1.id as t1_id, t1.field1 as t1_field1
等等