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
精彩评论