MySQL alias shorthand?

后端 未结 2 493
有刺的猬
有刺的猬 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.

提交回复
热议问题