简体   繁体   中英

Self-join in SQL Server Analysis Services

I have a table like this:

 WordId Set1 Set2 Related-wordId --------- ---- ----- -------- 101 A C1 105 102 B C2 101 103 A C1 102 

Then I need to getting the association rules between Word's Set1 and Related-word's Set2.

I've used self-referencing and define case/nested tables but at the result of dependency graph there is no difference between word's Set1 or Set2 and parent-word's Set1 or Set2!

What is the best solution for this Text-mining problem in SQL Server Analysis Services project?

In Analysis Services Templates We can use self Join query to do this

To open a template, right-click the template name and select Open, or drag the template into a query window that you already opened. After the query window is open, you can use commands on the toolbar or Query menu to help you build statements:

To check the syntax of a query, click Parse.

To run a query, click Execute.

To stop a query that is running, click Cancel Executing Query.

View the results of a query in the Results tab at the bottom of the screen.

Switch to the Messages tab to see the number of records returned, errors, query statements, and any other messages that are associated with the execution of the query. For example, if you execute a DAX statement against a model running in Direct Query mode, you can see the Transact-SQL statement that is generated by the xVelocity in-memory analytics engine (VertiPaq).

An SQL join clause - corresponding to a join operation in relational algebra - combines columns from one or more tables in a relational database . We know about inner join , left join , natural join etc in SQL . But most of them don't know what is self join and how does it work ? Now we are going to know what is self join and how does it work . We can use a self join when a table references data in itself. To clearly understand see the following table . 自我加入

See , This is our Employee table and we have to find out who works under the manager . Here Sonam is the manager and Rahul and Jay works under Sonam . Thereafter The manager of Sonam is Kunal . Furthermore The manager of Ram is Rani and Rani does'nt have any manager . That mean you can say She is CEO. Hope you will understand. So let's learn how to write this query . See the final report of their works under manager. read full article from here What is self join in SQL

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM