mysql - insert into department_new select a.*,null from departments a;" what does select a.* means -


i trying insert data 1 table in mysql, understand below query

insert department_new select a.*,null departments a; 

what select a.* means , how insert values correctly new table,

kindly help

a alias table departments

and a.* means column same departments.*

so complete statement

insert department_new select a.*,null departments a; 

means, values table departments should stored table department_new plus new column null should inserted.

it works fine, if order in both tables equals. in form there risk, copy values wrong column.


Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -