Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase «««45678»»

T SQL Expand / Collapse
Author
Message
Posted Wednesday, May 27, 2009 3:03 PM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: Administrators
Last Login: Today @ 12:50 PM
Points: 33,073, Visits: 15,187
When someone said they ran the SQL, I said with the corrected question they couldn't get those results.

The newsletter is what the question goes out as, but it could potentially be changed if we find issues. I'm not sure what you want. Do you want us to correct questions or not? It we correct them, the newsletter will be different.







Follow me on Twitter: @way0utwest

Forum Etiquette: How to post data/code on a forum to get the best help
Post #724593
Posted Wednesday, May 27, 2009 3:09 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Monday, April 7, 2014 4:10 PM
Points: 16, Visits: 72
Please supply the right list of options when you post a question.
the correct answer is
Em Ma
Vyas Mohan
Mohan Shobha
Shridhar Mohan
Sourabh Mohan
Post #724601
Posted Wednesday, May 27, 2009 3:16 PM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: 2 days ago @ 3:34 PM
Points: 1,293, Visits: 1,428
Mark Pratt (5/27/2009)
I don't look at these challenges much. Today's item doesn't encourage me to do so in the future.


I used to be the same, but now I try to figure out what the questioner is trying to test. I've learned a lot from these questions. I can be 'morally' right and still lose the point - I've still figured something out.

Post #724604
Posted Wednesday, May 27, 2009 3:24 PM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Thursday, December 20, 2012 1:03 PM
Points: 265, Visits: 589
cj_logan (5/27/2009)

Question

Why is the inner join the recommended option ? I know Microsoft recommends this way but no where can I find a reason ? According to the execution plan both are the same and both cost 50%

SELECT t1.en [Em], t2.en [Ma] FROM E t1, E t2 WHERE t1.mid = t2.eid
order by t1.en

SELECT t1.en [Em], t2.en [Ma] FROM E t1 inner join E t2 on t1.mid = t2.eid
order by t1.en



Joins in ANSI syntax can be made explicit without mangling the where logic. Parsers and optimizations have less ambiguity to deal with under certain conditions. The old syntax of using *= for left and right joins can now be done away. Cross joins also become explicit. For programming, the cleaner and more explicit ANSI syntax could lead to faster debugging. It took me a while to transition, but now that I did, I like it.
Post #724606
Posted Wednesday, May 27, 2009 3:33 PM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Monday, July 21, 2014 8:35 AM
Points: 3,642, Visits: 72,429
sjsubscribe (5/27/2009)


Joins in ANSI syntax can be made explicit without mangling the where logic. Parsers and optimizations have less ambiguity to deal with under certain conditions. The old syntax of using *= for left and right joins can now be done away. Cross joins also become explicit. For programming, the cleaner and more explicit ANSI syntax could lead to faster debugging. It took me a while to transition, but now that I did, I like it.


I feel lucky... when I got involved with SQL Server, DBs, and DB Theory ANSI style joins were available. I actually had queries back on SQL 7 that performed better when I specified ANSI joins than when I used that kack nasty syntax (for whatever reason, but I was seeing actual differences in performance back then).

I remember looking at a 12 table join in the older where clause syntax and spending quite a bit of time trying to figure out how all the joins worked. The first thing I did after I figured it out was to convert the query to ANSI syntax.

For a few years I was teaching Intro to DB Theory at a local community college. I explained the Where clause Join and told my students if they ever turned in work using it that I'd take off points for bad style.




--Mark Tassin
MCITP - SQL Server DBA
Proud member of the Anti-RBAR alliance.
For help with Performance click this link
For tips on how to post your problems
Post #724612
Posted Wednesday, May 27, 2009 3:35 PM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Friday, July 25, 2014 3:54 PM
Points: 413, Visits: 393
Steve Jones - Editor (5/27/2009)
The newsletter is what the question goes out as, but it could potentially be changed if we find issues. I'm not sure what you want. Do you want us to correct questions or not? It we correct them, the newsletter will be different.
How about a friendly suggestion to indicate on the web page that the question is different from what was mailed out? Maybe right above the list of answer choices? I like the QOTD's. They've helped me learn more about MSSQL.
Post #724614
Posted Wednesday, May 27, 2009 10:46 PM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Monday, July 21, 2014 2:56 AM
Points: 2,603, Visits: 2,061
I too have seleted option 3 hence wrong.... BAD LUCK!!

I do agree with STEVE JONES; we need to be positive why people are more worried about points more than that wright or wrong? I liked positive approach of "ppcx" by giving suggestion.

All are human beings and made mistakes... We are not COMPUTERS!

We need to encourage people to post more and wright about SQL.

SUCCESS COMES OUT OF FAILURE ONLY.



---------------------------------------------------
"Thare are only 10 types of people in the world:
Those who understand binary, and those who don't."
Post #724793
Posted Thursday, May 28, 2009 12:04 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Thursday, January 2, 2014 3:49 AM
Points: 29, Visits: 28
Hi Guys

This answer is correct when there is no order by clause in the question.

row1 - Vyas Mohan
row2 - Mohan Shobha
row3 - Shridhar Mohan
row4 - Sourabh Mohan


else

this is correct.
Row 1 - Mohan Shobha | Row 2 - Shridhar Mohan | Row 3 - Sourabh Mohan | Row 4 - Vyas Mohan
Post #724816
Posted Thursday, May 28, 2009 5:20 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, July 18, 2012 11:09 PM
Points: 9, Visits: 9
first Row- Mohan Shobha
Second Row-Shridhar Mohan
third Row- Sourabh Mohan
Fourth Row- Vyas Mohan
Post #724947
Posted Thursday, May 28, 2009 11:51 AM
Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Thursday, July 17, 2014 10:56 AM
Points: 3,924, Visits: 1,607
Barry McConnell (5/27/2009)
SanjayAttray (5/27/2009)
WOW.........never seen so many complaints for a single question on QOD before. Good job Reddy. You made all forum posters stand united.
You must not have seen the MDX Except question then!


Yep Barry. Look like I missed that fun before.


SQL DBA.
Post #725295
« Prev Topic | Next Topic »

Add to briefcase «««45678»»

Permissions Expand / Collapse