Solved

Get Related topics based on WordWeight

Posted on 2014-01-29
8
147 Views
Last Modified: 2014-01-31
Dear all,
I have tale NewsSYSNewsTags (NewsSYSNewsTagsID PK, NewsID (fk), NewsSYSTagsID (fk)WordWeight

for given NewsID how can get the most related newsID

thanks
0
Comment
Question by:ethar1
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 65

Expert Comment

by:Jim Horn
Comment Utility
>for given NewsID how can get the most related newsID
Define 'most related', preferable with some mockup 'before and after' data.  

Where I'm from you could be cousins multiple ways.
0
 

Author Comment

by:ethar1
Comment Utility
based on WordWeight as mentioned
0
 
LVL 16

Expert Comment

by:Surendra Nath
Comment Utility
what is meant my word weight is it another column in a different table or word weight is some kind of functional requirement.

if it is the later, can you please take an example and explain to us.
0
 

Author Comment

by:ethar1
Comment Utility
Table :
 NewsSYSNewsTags (NewsSYSNewsTagsID PK, NewsID (fk), NewsSYSTagsID (fk), WordWeight)

yes its a column in same table  its a float field.
0
Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

 
LVL 16

Expert Comment

by:Surendra Nath
Comment Utility
ok, can you please give us some examples with the data for the table and also the output that you are expecting..

while providing this data, please let us know how this output has come up...
The data can be a dummy data nothing in your real tables.
0
 
LVL 12

Expert Comment

by:Harish Varghese
Comment Utility
Are you looking for NewsIDs with NewsTags having same WordWeight as given NewsID?
If there are multiple NewsTags in the given NewsID, what should be the criteria to pick the other relevant NewsID?
0
 

Author Comment

by:ethar1
Comment Utility
@Harish Varghese, yes this is exactly what I am looking for , sure there are multiple NewsTags in the given NewsID.
The criteria (fmho):
for each NewsSYSTagsID of given NewsID
insert in releated table
select  NewsID  where WordWeight = +- 5% of (WordWeight  of GivenNewsID) and NewsID <> given NewsID
order by WordWeight  Desc


thanks
0
 
LVL 12

Accepted Solution

by:
Harish Varghese earned 500 total points
Comment Utility
Hello,

Here is a query to identify the related news. I am selecting the news tag id and the word weights for the given news id and related news id. You may pick only the columns you want finally.
Insert into @RelatedNewsIDs (MainNewsID, NewsSYSTagsID, MainWordWeight, RelatedNewsID, RelatedWordWeight)
Select Distinct Main.NewsID, Main.NewsSYSTagsID, Main.WordWeight, Related.NewsID, Related.WordWeight
From NewsSYSNewsTags Main, NewsSYSNewsTags Related
Where Related.NewsID <> Main.NewsID
And Related.NewsSYSTagsID  = Main.NewsSYSTagsID 
And Related.WordWeight >= Main.WordWeight - Main.WordWeight * .05 
And Related.WordWeight <= Main.WordWeight + Main.WordWeight * .05 
And Main.NewsId = 1001 --Your news ID to search

Open in new window

-Harish
0

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Join & Write a Comment

Suggested Solutions

In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now