I am New TO Programming
Am HAving 2 Table
One Table Having
Coloum
ID and NAmeOf Eventt
And Other Table
Having Coloumn
ID and Imagepath
I want To Retrive Id related the NAme Of Event and Want To Insert That ID into other Table
at the same time i want to Insert Imagepath in front Of that Id
I have Tried
this
insert into imagepath(id,NameOfEvent) select id,NameOfEvent from trydb where nameofevent='k'
its working But How To Insert Image Path...infront Of That Id

Insert into table t
select ... From

I am New TO Programming
Am HAving 2 Table
One Table Having
Coloum
ID and NAmeOf Eventt
And Other Table
Having Coloumn
ID and Imagepath
I want To Retrive Id related the NAme Of Event and Want To Insert That ID into other Table
at the same time i want to Insert Imagepath in front Of that Id
I have Tried
this
insert into imagepath(id,NameOfEvent) select id,NameOfEvent from trydb where nameofevent='k'
its working But How To Insert Image Path...infront Of That Id

Hi Kau;
Insert statement is for inserting values which matches with the other table you are getting the values from..
For your case, you can try this:

SELECT a.ColumnID,a.NameOfEvent,b.ImagePath
into newtable
from Table1 a
inner join Table2 b on b.ColumnID = a.ColumnID

This will basically create new table with values from both table and imagepath for each event, from the new table you can put your condition and retrive what you need only..

Hope my suggestion solves your question. Will appreciate your feedback.

Be a part of the DaniWeb community

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