首页 > 如何批量为以下SQL的字段取别名

如何批量为以下SQL的字段取别名

select comment.*,u1.*,u2.* from comment left join user u1 on u1.token=comment.userToken left join user u2 on u2.token=comment.targetUserToken where goMsgId=13





希望 comment.* 这个表的所有字段都以comment.id comment.name comment.text 这样的形式开头改如何修改这个SQL
而不是一个个的去取别名 comment.id as com.id,coment.name as com.name


如果是程序里面的话,可以从数据库读取这个表的字段,再循环这个表的字段,然后字符串拼接sql语句

【热门文章】
【热门文章】