开发者

Mysql define variable by AS or direct

What's the difference between these 2 开发者_如何转开发queries?

select pc.* from payment_coupon pc
select pc.* from payment_coupon AS pc


Just one word: Readability.

Using AS is optional, like described here in the manual.


using AS for column name is mandatory , for table name u just write alias with a space

AS is optional for tablename

Eg:

SELECT column1 AS c1 FROM table t // work
SELECT column1 c1 FROM table t // not works
SELECT column1 AS c1 FROM table AS t  //work
SELECT column1 c1 FROM table AS t //  not works
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜