Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Join issue

Author  Topic 

kyma
Starting Member

11 Posts

Posted - 2008-08-05 : 09:40:20
I have data in two tables that I have to push into a third.

ITEMS:
itemid, uri

INDEX:
itemid, score

and the third...

CONTENT_TYPE
itemid, uri, score

How can I push the data from the first two and get to align correctly in the third. I'm guessing I'd use a join of some kind, but I've never done this before. Can someone offer some advice please?

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2008-08-05 : 09:48:45
[code]
insert into CONTENT_TYPE (itemid, uri, score)
select i.itemid, i.uri, x.score
from ITEMS i
INNER JOIN INDEX x ON i.itemid = x.itemid
[/code]


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2008-08-05 : 09:52:45
What about dups?

You need to explain a little more about what you're trying to do.



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

kyma
Starting Member

11 Posts

Posted - 2008-08-05 : 09:53:27
Thanks a lot, much appreciated
Go to Top of Page

kyma
Starting Member

11 Posts

Posted - 2008-08-05 : 10:00:08
I have content which is being aggregated and dumped in an MSSQL database, and I need to take the relevant fields and dynamically push them into a MySQL database through linked server for web publishing. The table structure differs in the web CMS, but I have to make sure that the right uri is associated with the right content item and the right score etc.

Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-08-05 : 13:01:06
quote:
Originally posted by kyma

I have content which is being aggregated and dumped in an MSSQL database, and I need to take the relevant fields and dynamically push them into a MySQL database through linked server for web publishing. The table structure differs in the web CMS, but I have to make sure that the right uri is associated with the right content item and the right score etc.




so what happens if you have more than 1 records existing with same itemid value in any of tables? do you want to take them both?
Go to Top of Page

kyma
Starting Member

11 Posts

Posted - 2008-08-06 : 05:52:01
No, I'd need them to be aligned into the same record
Go to Top of Page
   

- Advertisement -