Viewing 15 posts - 241 through 255 (of 1,034 total)
Good back to basics question... I'm glad I had my morning coffee first or I would have missed the 1/True bit. 🙂
August 14, 2012 at 6:49 am
You know you're starting to get paranoid when you're always looking for the catch.
Glad that I couldn't find one and got it correct 🙂
August 13, 2012 at 6:48 am
info 58414 (8/9/2012)
Hi,how can I get effectively max(version) to identify any PersonID with multiple VersionID?
That's what GROUP BY and MAX are for 🙂
DECLARE @persons TABLE(
personid INT,
version INT)
INSERT @persons
VALUES(1,1),(1,2),(1,3),(2,1),(2,2),(3,1),(4,1),(4,2)
SELECT
personid,
maxversion = MAX(version)
FROM...
August 9, 2012 at 9:16 am
Koen Verbeeck (8/8/2012)
Spent 15 minutes looking for the gotcha... (what do you want, after yesterday's question)😀
/agree I was starting to get paranoid.... finally gave up and went with my...
August 8, 2012 at 11:41 am
MyDoggieJessie (8/7/2012)
All jokes aside 😉 when removing the index hint the optimizer automatically turns it into an index scan...so that's why I was trying to force it to use the...
August 7, 2012 at 1:17 pm
Ok, next time I will remind myself to read the dates on messages in here... at least one response to something that was already handled last month. Oops 🙂
August 7, 2012 at 1:14 pm
Luis Cazares (8/7/2012)
But it does matter if we're talking about number of rows returned.
With select * you can get either 1 or 0 (in this particular case).
With select COUNT(*) you'll...
August 7, 2012 at 1:13 pm
Lynn Pettis (8/1/2012)
morepainot (8/1/2012)
"Msg 2714, Level 16, State 3, Procedure usp_PreStageValidation, Line 185
There is already...
August 7, 2012 at 12:59 pm
Jeff Moden (7/26/2012)
Sean Lange (7/26/2012)
August 7, 2012 at 12:48 pm
manub22 (7/26/2012)
August 7, 2012 at 12:46 pm
Luis Cazares (8/7/2012)
SQLRNNR (8/7/2012)
As far as I remember, the "Select count(*)" was changed by Steve after the discussion on the previous question and originally had a "Select *".
However, I don't...
August 7, 2012 at 12:38 pm
I'm like Jeff.
I use CTE's to move subqueries to the top so I can treat them as the proper named derived tables that they are.
I also use them when I...
August 7, 2012 at 10:02 am
Must agree with Sean and Dwain.
Either pass in separated values and split the strings to a temporary table/table variable and join to that, or if you feel comfortable pass in...
August 7, 2012 at 9:56 am
Could be a test question.
A decade ago when I taught Database Theory, my tests were take home week long projects.
25 T/F
25 Multiple Choice
25 Fill in the blank
25 point Essay question.
During...
August 7, 2012 at 9:44 am
declare @ProductLine table
(ProductlineID int)
declare @Products table
(ProductLineID int,
ProductID int,
Status int)
insert into @ProductLine values (1)
Insert into @ProductLine values (2)
Insert into @ProductLine values (3)
Insert into @ProductLine values...
August 7, 2012 at 9:37 am
Viewing 15 posts - 241 through 255 (of 1,034 total)