November 21, 2011 at 9:29 am
good question!!!!!
November 21, 2011 at 9:34 am
tks for the question - tks to all who weighed in already - nothing more I can say other than I agree...
Happy Monday π
November 21, 2011 at 9:43 am
A good way to start the short week! Thanks!
November 21, 2011 at 9:47 am
Ninja's_RGR'us (11/21/2011)
I should get a macro program to be able to just hit something like ctrl-alt-shit-i :-D.
Is that key only on Canadian keyboards? I don't think I have one of those on mine.
November 21, 2011 at 9:52 am
calvo (11/21/2011)
Ninja's_RGR'us (11/21/2011)
I should get a macro program to be able to just hit something like ctrl-alt-shit-i :-D.
Is that key only on Canadian keyboards? I don't think I have one of those on mine.
Which one?
November 21, 2011 at 10:34 am
Ninja's_RGR'us (11/21/2011)
calvo (11/21/2011)
Ninja's_RGR'us (11/21/2011)
I should get a macro program to be able to just hit something like ctrl-alt-shit-i :-D.
Is that key only on Canadian keyboards? I don't think I have one of those on mine.
Which one?
I've bolded it in the quotation so you can see. π
Tom
November 21, 2011 at 10:36 am
L' Eomot InversΓ© (11/21/2011)
Ninja's_RGR'us (11/21/2011)
calvo (11/21/2011)
Ninja's_RGR'us (11/21/2011)
I should get a macro program to be able to just hit something like ctrl-alt-shit-i :-D.
Is that key only on Canadian keyboards? I don't think I have one of those on mine.
Which one?
I've bolded it in the quotation so you can see. π
Also called the vista windows key by some :w00t:
November 21, 2011 at 10:49 am
Thanks for the question - perfect for getting my brain back to room temperature on a Monday.
November 22, 2011 at 6:16 am
I knew this one from experience :blush:
November 23, 2011 at 3:36 am
It's becoming more a game of 'what point is the questioner really trying to make' than actually looking at the code and working out the answer. Maybe everyone could put an 'IT DEPENDS' answer on their questions?
November 29, 2011 at 8:10 pm
Damn, I knew that the output params were not being used and returned by the procedure.
Still I was too fast to click the wrong answer. :blush:
But TOP(1) with no ORDER BY on a table with no primary key doesn't make the options very accurate, does it?
Nevertheless it's a nice tricky question. Thank you. π
Best regards,
Best regards,
Andre Guerreiro Neto
Database Analyst
http://www.softplan.com.br
MCITPx1/MCTSx2/MCSE/MCSA
December 1, 2011 at 6:02 am
Thanks for the question. I got it right for the wrong reason.
http://brittcluff.blogspot.com/
December 22, 2011 at 12:52 am
Hi,
Before answering the question. i tested with test data like
declare @test-2 table(mm varchar(10))
INSERT INTO @test-2 VALUES ('TEST')
INSERT INTO @test-2 VALUES ('abc')
INSERT INTO @test-2 VALUES ('145.87')
INSERT INTO @test-2 VALUES ('1059.31')
INSERT INTO @test-2 VALUES ('38.49')
insert into @test-2 values('bnsdjsd')
the answer is test.
SELECT TOP 1 mm FROM @test-2 .I know that results will vary for every execution if we did not mentioned order by.but here even though i executed several time its giving the same answer.so i got this answer correct.
Then i tested with below code
declare @test-2 table(mm varchar(10))
INSERT INTO @test-2 VALUES ('145.87')
INSERT INTO @test-2 VALUES ('TEST')
INSERT INTO @test-2 VALUES ('abc')
INSERT INTO @test-2 VALUES ('1059.31')
INSERT INTO @test-2 VALUES ('38.49')
insert into @test-2 values('bnsdjsd')
SELECT TOP 1 mm FROM @test-2
its giving the output '145.87'.
I think the above result depends on the insert statement.which ever first inserted it is showing that only.Please clarify
me if am wrong.
Malleswarareddy
I.T.Analyst
MCITP(70-451)
December 22, 2011 at 1:06 am
malleswarareddy_m (12/22/2011)
I think the above result depends on the insert statement.which ever first inserted it is showing that only.Please clarifyme if am wrong.
You are somewhat right and somewhat wrong.
The table has no keys or clustered index defined, so the storage structure is a heap. When querying heaps, rows will usually be returned in the order in which they were inserted. This is not guaranteed, however.
December 22, 2011 at 5:35 am
Hugo Kornelis (12/22/2011)
malleswarareddy_m (12/22/2011)
I think the above result depends on the insert statement.which ever first inserted it is showing that only.Please clarifyme if am wrong.
You are somewhat right and somewhat wrong.
The table has no keys or clustered index defined, so the storage structure is a heap. When querying heaps, rows will usually be returned in the order in which they were inserted. This is not guaranteed, however.
Ya,i know that if we defined any index than the result set is dependeds on the index.(asc,desc).if there was no index defined than the results will returned in the order in which they were inserted right?
Malleswarareddy
I.T.Analyst
MCITP(70-451)
Viewing 15 posts - 16 through 30 (of 30 total)
You must be logged in to reply to this topic. Login to reply