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.
| 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, uriINDEX:itemid, scoreand the third...CONTENT_TYPEitemid, uri, scoreHow 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.scorefrom ITEMS i INNER JOIN INDEX x ON i.itemid = x.itemid[/code] KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
kyma
Starting Member
11 Posts |
Posted - 2008-08-05 : 09:53:27
|
Thanks a lot, much appreciated |
 |
|
|
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. |
 |
|
|
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? |
 |
|
|
kyma
Starting Member
11 Posts |
Posted - 2008-08-06 : 05:52:01
|
| No, I'd need them to be aligned into the same record |
 |
|
|
|
|
|
|
|