Hi all,

I am using mySql query to insert a row into table.

I have two tables as Table1 and ZTable1.

Table1 has 3 fields TId,TName,TAge .

ZTable1 has 4 fields ZTId,TId,TName,TAge.

Table1 has 1 row.

1, Myl,24.

Now i want to insert values to ZTAble1 as 1,(1,Myl,24) these values from Table1.

I insert that row in ZTable1 along with 1 as ZTId.

How can I do this?

Plz very urgent.

Help me.

Recommended Answers

insert into ZTable1 select 1, ZTable.* from ZTable

Or maybe you want

insert into ZTable1 select TId,TId,TName,TAge from ZTable

It's hard to tell from your post.

Jump to Post

All 2 Replies

insert into ZTable1 select 1, ZTable.* from ZTable

Or maybe you want

insert into ZTable1 select TId,TId,TName,TAge from ZTable

It's hard to tell from your post.

Thank you smantscheff. I solved the problem using your tip

insert into ZTable1 select 1, ZTable.* from ZTable

Or maybe you want

insert into ZTable1 select TId,TId,TName,TAge from ZTable

It's hard to tell from your post.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.