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 |
|
Axonn
Starting Member
2 Posts |
Posted - 2009-08-06 : 12:04:51
|
| Hi everybody. My first message here ::- D. I hope it won't be the last, hehe ::- D. I got a very simple question...As far as I understood, this is a Theta Join:Select From Table A, Table B, Table C Where A.col = B.col, B.col = C.colMy question, short and simple:Does it damage performance?Does it have any other disadvantage other than that I cannot have NULLs returned in any of the left or right tables? (like for example I could do with Outer Join?).- = E C H Y S T T A S = -The Greater Mind Balance |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2009-08-06 : 12:47:01
|
No, it doesn't damage performance. N 56°04'39.26"E 12°55'05.63" |
 |
|
|
craigwg
Posting Yak Master
154 Posts |
Posted - 2009-08-06 : 13:06:28
|
| Theta join is more of a mathematical term. It just means a join using a symbol like any of the following: = < <= >= > <>All joins in SQL use these, most commonly the equal sign, =. Specifically this is called an equi-join. An equi-join is a type of theta join. What you are describing above is a standard inner join. That simple means you are pulling data from more than one table, and those tables are related (almost like you're running a database or something!!) This doesn't damage performance. The data you need is in seperate tables, most likely with good cause. You are simply using the database, so damage doesn't enter into it. The only way you could make this inefficient would be to join tables from which you are not selecting any data. (more tables in the join clause than in the select clause). The syntax in your statement above is off, but the theory is there.Craig Greenwood |
 |
|
|
Axonn
Starting Member
2 Posts |
Posted - 2009-08-06 : 14:10:40
|
| Hi. Thanks for answering guys ::- ).Can I do outer join with that stuff?I'm asking because I'm using NHibernate and I can't seem to find how to join tables with "Join" (apparently it involves some configuring XMLs work which I don't have time for right now).- = E C H Y S T T A S = -The Greater Mind Balance |
 |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2009-08-06 : 14:24:39
|
| http://ayende.com/Blog/archive/2009/04/20/nhibernate-mapping-ltjoingt.aspxIt looks like you only have to set "optional=true" to enable outer joins. Seems pretty easy to me. |
 |
|
|
|
|
|
|
|