0

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

3
Contributors
2
Replies
9
Views
7 Years
Discussion Span
Last Post by princekool
0

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.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.