Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
Article Discussions
»
Article Discussions by Author
»
Discuss content posted by Slick84
»
What's the count?
21 posts, Page 1 of 3
1
2
3
»
»»
What's the count?
Rate Topic
Display Mode
Topic Options
Author
Message
Slick84
Slick84
Posted Wednesday, March 10, 2010 9:18 PM
SSC-Addicted
Group: General Forum Members
Last Login: Monday, October 31, 2011 1:10 PM
Points: 480,
Visits: 1,163
Comments posted to this topic are about the item
What's the count?
--
Post #880671
SQLRNNR
SQLRNNR
Posted Wednesday, March 10, 2010 11:02 PM
SSCoach
Group: General Forum Members
Last Login: Yesterday @ 3:33 PM
Points: 18,858,
Visits: 12,443
Thanks for the question. Nice job.
Jason
AKA CirqueDeSQLeil
I have given a name to my pain...
MCM SQL Server 2008
SQL RNNR
Posting Performance Based Questions - Gail Shaw
Posting Data Etiquette - Jeff Moden
Hidden RBAR - Jeff Moden
VLFs and the Tran Log - Kimberly Tripp
Post #880708
Sree Arjun Div
Sree Arjun Div
Posted Wednesday, March 10, 2010 11:19 PM
SSCrazy
Group: General Forum Members
Last Login: Wednesday, May 08, 2013 3:44 AM
Points: 2,173,
Visits: 1,350
Nice Question ....Today i learned this from Central...Good Question
Post #880717
jshailendra
jshailendra
Posted Thursday, March 11, 2010 12:13 AM
Old Hand
Group: General Forum Members
Last Login: Friday, December 21, 2012 5:24 AM
Points: 366,
Visits: 436
Good question..never thought of using count(*) for 2 tables in one T-SQL...thanks for question
Post #880751
aamirjani4u
aamirjani4u
Posted Thursday, March 11, 2010 12:50 AM
Forum Newbie
Group: General Forum Members
Last Login: Tuesday, March 15, 2011 10:49 PM
Points: 5,
Visits: 10
count is basically. Counting the each record of that table.
For Example. Table A has 3 rows then count = 3. if table B has 4 Rows then count=4.
If combine both tables then 3 * 4 = 12 rows and count = 12
Post #880768
Carlo Romagnano
Carlo Romagnano
Posted Thursday, March 11, 2010 1:05 AM
SSCommitted
Group: General Forum Members
Last Login: Today @ 1:10 AM
Points: 1,997,
Visits: 1,866
if one table has one o more rows and the other is void, the result is 0.
NumberOfRows * 0 = 0
Post #880775
Sree Divya
Sree Divya
Posted Thursday, March 11, 2010 2:03 AM
SSCrazy
Group: General Forum Members
Last Login: Tuesday, April 23, 2013 10:52 PM
Points: 2,118,
Visits: 343
In Point of Interview Very Intelligence Question ......Nice...hmmmmm My Answer is Correct............!
Post #880809
kaspencer
kaspencer
Posted Thursday, March 11, 2010 2:31 AM
Ten Centuries
Group: General Forum Members
Last Login: Yesterday @ 8:30 AM
Points: 1,419,
Visits: 267
That's is a good question, illustrating the need for careful joins!
For those that don't know, this kind of result is called a "cartesian product", and if you allow it to happen in a real-world application with even a few hundred rows in either table, you are in for something of an explosion of complaints from your users, to say the least.
Ken.
Post #880821
nigel.
nigel.
Posted Thursday, March 11, 2010 3:43 AM
Ten Centuries
Group: General Forum Members
Last Login: Monday, June 03, 2013 9:46 AM
Points: 1,164,
Visits: 2,603
Very good question.
However I think that the explanation is a bit lacking, and could explain in more detail what is happening here and what a 'cross join'/'cartesian product' is.
Here are some links that may help:
Cross Join
Cartesian Product
--
Nigel
Useful Links:
How to post data/code on a forum to get the best help
The "Numbers" or "Tally" Table - Jeff Moden
Post #880860
Daniel Bowlin
Daniel Bowlin
Posted Thursday, March 11, 2010 8:08 AM
SSCrazy
Group: General Forum Members
Last Login: 2 days ago @ 8:36 AM
Points: 2,681,
Visits: 2,423
This one definitely made me think a minute or two.
Post #881038
« Prev Topic
|
Next Topic »
21 posts, Page 1 of 3
1
2
3
»
»»
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.