views:

55

answers:

1

Can we use aliases with insert into syntax?

None of the following work:

INSERT INTO tableblabla AS bla
INSERT INTO bla tableblabla
INSERT INTO tableblabla bla

I can't seem to find any information about this; is there a valid way to use aliases in an INSERT statement?

About the possible reasons: http://bugs.mysql.com/bug.php?id=3275

Thanks in advance,
MEM

+4  A: 

The INSERT syntax doesn't allow for aliases. Why would you need one in an INSERT statement anyways? You can only INSERT into one table at a time.

Daniel Vandersluis
+1: Only reason I can see the need for an alias is if in a correlated subquery...
OMG Ponies
I was asking if it makes sense because, I do understand that I do not know all the mysql possibilities on queries, so, and since I learned that it's a good pratice to use alias in order to better understand what are we using... I thought that this would be pertinent. Still, the answer part: "The Insert syntax doesn't allow for aliases" was all that I needed to know for now. ;) For reasons, or probably reasons, see my question edition earlier today. Thanks a lot. :)
MEM