Can I hide a part of the text by a "More..." link?
Syntax Question
Hello Guest
  
  • Login
• Register…
• Start blog
  • Who, Where, When
• What can I do?
• What to Read?
  • Polls
• Avatars
• Interests
  • Cities and Countries
• Random blog
• Users search
  • Search
• Games
• Tests
• QAIX
  • Сообщества
• Talxy Chat
• Horoscope
• Online
 
Зарегистрируйся!

QAIX > MS SQL database development > Syntax Question 25 November 2007 16:51:45

  Recent blog posts: 
  They have birthday today: 
  Forums:   
  Discuss: 
  Recent forum topics: 
  Recent forum comments:
  Moderators:

Syntax Question

Guest 25 November 2007 16:51:45
 SQL Server 2000

When joining tables, some use:
AliasTableName.Colu­mnName = AliasTableName.Colu­mn
while others use
LEFT/RIGHT etc JOIN .......

Is one better than the other in cases where the join is a simple JOIN
of equality ?

Curious ...

Thanks,

Craig

Add comment
David Portas 11 May 2005 17:50:41 permanent link ]
 In a WHERE clause your first example would perform an INNER JOIN
whereas LEFT and RIGHT are keywords for OUTER JOINs. So these are not
equivalent at all.

For INNER joins either put the criteria in the WHERE clause or use the
FROM ... INNER ... ON syntax. The choice mainly comes down to personal
preference and coding style within your organization.

For OUTER joins always use the { { LEFT | RIGHT | FULL } [OUTER] } JOIN
syntax. Avoid the obsolete *= / =*, which has some problems and
limitations and won't be fully supported in future.

--
David Portas
SQL Server MVP
--

Add comment
ThatsIT.net.au 18 November 2007 09:53:41 permanent link ]
 
"Evertjan." <exjxw.hannivoort@i­nterxnl.net> wrote in message
news:Xns99EBC912567­ACeejj99@194.109.133­.242...
McKirahan wrote on 17 nov 2007 in
microsoft.public.in­etserver.asp.general­:
Yes; though your first set of parentheses is wrong.
Also, for readability, take a look at this:
If (SubsQuestions = "Yes" And Area = "Six") _
Or (SubsQuestions = "Yes" And Area = "Seven") Then
'Do stuff
Else
'Do not
End If
I prefer for readability:
SQy = SubsQuestions = "Yes"
A6 = Area = "Six"
A7 = Area = "Seven"
If SQy AND (A6 OR A7) Then
'Do stuff
Else
'Do not
End If
or:
SQy = SubsQuestions = "Yes"
A6 = Area = "Six"
A7 = Area = "Seven"
A6orA7 = A6 OR A7
If SQy AND A6orA7 Then
'Do stuff
Else
'Do not
End If

To use a bit of both your suggestions
testQ = (SubsQuestions = "Yes")
test6 = (Area = "Six")
test7 = (Area = "Seven")

IF testQ then
IF test6 OR test7 THEN
'Do stuff
END IF
ELSE
'Do not
END IF





--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Add comment
ThatsIT.net.au 25 November 2007 16:51:45 permanent link ]
 
"McKirahan" <News@McKirahan.com­> wrote in message
news:dYKdnbRn_v3avd­ranZ2dnUVZ_rWtnZ2d@c­omcast.com...
"ThatsIT.net.au" <me@thatsit> wrote in message
news:0B03165D-385B-­490C-AB08-AB59F67BC4­6D@microsoft.com...
"McKirahan" <News@McKirahan.com­> wrote in message
news:WpmdnWFbL48syt­3anZ2dnUVZ_tuonZ2d@c­omcast.com...
"ThatsIT.net.au" <me@thatsit> wrote in message
news:67AA2DFD-4317-­4A5D-8BDD-14D45520AD­DA@microsoft.com...
"Evertjan." <exjxw.hannivoort@i­nterxnl.net> wrote in message
news:Xns99EBC912567­ACeejj99@194.109.133­.242...
[snip]
I prefer for readability:
SQy = SubsQuestions = "Yes"
A6 = Area = "Six"
A7 = Area = "Seven"
If SQy AND (A6 OR A7) Then
'Do stuff
Else
'Do not
End If
[snip]
To use a bit of both your suggestions
testQ = (SubsQuestions = "Yes")
test6 = (Area = "Six")
test7 = (Area = "Seven")
IF testQ then
IF test6 OR test7 THEN
'Do stuff
END IF
ELSE
'Do not
END IF
Sorry, that's not equivalent;you don't handle:
IF test6 OR test7 THEN's ELSE
yes it is,
first subquerys must be true or it fails, only if subquerys is true need
we
test test6 or test7
Sorry, it's not.
If the second test fails you do not perform "Do not".
IF testQ then
IF test6 OR test7 THEN
'Do stuff
ELSE <= you don't allow for this
'Do not
END IF
ELSE
'Do not
END IF

OK I see what you mean, my error

Add comment
 

Add new comment

As:
Login:  Password:  
 
 
  
 
Пожалуйста, относитесь к собеседникам уважительно, не используйте нецензурные слова, не злоупотребляйте заглавными буквами, не публикуйте рекламу и объявления о купле/продаже, а также материалы нарушающие сетевой этикет или УК РФ.


QAIX > MS SQL database development > Syntax Question 25 November 2007 16:51:45

see also:
Re: [Fwd: Re: Build fails when run in…
anthill website down?
is it possible to build a specific…
пройди тесты:
see also:
Hallo
It's me
Hi!I'm ok)Your?

  Copyright © 2001—2008 QAIX
Idea: Miсhael Monashev
Помощь и задать вопросы можно в сообществе support.qaix.com.
Сообщения об ошибках оставляем в сообществе bugs.qaix.com.
Предложения и комментарии пишем в сообществе suggest.qaix.com.
Информация для родителей.
Write us at:
If you would like to report an abuse of our service, such as a spam message, please .