MySQL alias shorthand?

后端 未结 2 461
有刺的猬
有刺的猬 2021-01-19 16:55

I need to select all columns from two tables, but need to be able to differentiate between them in the result.

Is there a shorthand method of giving each column in t

相关标签:
2条回答
  • 2021-01-19 17:06

    No, ALIAS is only for single columns. The only shorthand is to remove the AS:

    SELECT column_123 col FROM x
    

    Returns col as the alias.

    0 讨论(0)
  • 2021-01-19 17:13

    No, you'll need to name them explicitly.

    0 讨论(0)
提交回复
热议问题