SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Combining two query result sets.


Combining two query result sets.

Author
Message
Eugene Elutin
Eugene Elutin
SSCarpal Tunnel
SSCarpal Tunnel (5K reputation)SSCarpal Tunnel (5K reputation)SSCarpal Tunnel (5K reputation)SSCarpal Tunnel (5K reputation)SSCarpal Tunnel (5K reputation)SSCarpal Tunnel (5K reputation)SSCarpal Tunnel (5K reputation)SSCarpal Tunnel (5K reputation)

Group: General Forum Members
Points: 4992 Visits: 5478
Lynn Pettis (5/14/2013)
Eugene Elutin (5/14/2013)
William Gary Wright (5/14/2013)
I left the office last night being half way done writing a script to create a database with some data in it for you all to look at. I came in this morning and read the new replies to my post. I had never considered a join. All of the examples of joins I have seen there was always an = involved and I had not seen >= used in a join. This worked great and it makes sense to me.

Thanks Lynn,
Bill

PS
How does this points thing work?


This article is worth to read (about hidden "RBAR" in triangular joins):

http://www.sqlservercentral.com/articles/T-SQL/61539/


Eugene,

Yes, it is a good article on triangular joins, I just hope you don't think that the code I provided is a triangular join. It is actually a bound join with a lower an upper bound.



No, it has nothing to do with your code. Just OP has stated that he has never seen JOINs with "<=" used before. So, I thought, before OP will became to excited about it, he better to be aware of triangular join problem which may occur when "non-equal" compare is used in joins.

_____________________________________________
"The only true wisdom is in knowing you know nothing"
"O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
(So many miracle inventions provided by MS to us...)

How to post your question to get the best and quick help
Lynn Pettis
Lynn Pettis
SSC-Dedicated
SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)

Group: General Forum Members
Points: 39437 Visits: 38552
Eugene Elutin (5/14/2013)
Lynn Pettis (5/14/2013)
Eugene Elutin (5/14/2013)
William Gary Wright (5/14/2013)
I left the office last night being half way done writing a script to create a database with some data in it for you all to look at. I came in this morning and read the new replies to my post. I had never considered a join. All of the examples of joins I have seen there was always an = involved and I had not seen >= used in a join. This worked great and it makes sense to me.

Thanks Lynn,
Bill

PS
How does this points thing work?


This article is worth to read (about hidden "RBAR" in triangular joins):

http://www.sqlservercentral.com/articles/T-SQL/61539/


Eugene,

Yes, it is a good article on triangular joins, I just hope you don't think that the code I provided is a triangular join. It is actually a bound join with a lower an upper bound.



No, it has nothing to do with your code. Just OP has stated that he has never seen JOINs with "<=" used before. So, I thought, before OP will became to excited about it, he better to be aware of triangular join problem which may occur when "non-equal" compare is used in joins.


Okay, just wanted to be sure. Didn't want the article to scare off the OP from the code I provided.

Definitely a good thing to point out the issues that can occur with triangular joins.

Cool
Lynn Pettis

For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here or when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here and here
Managing Transaction Logs

SQL Musings from the Desert Fountain Valley SQL (My Mirror Blog)
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search