Viewing 15 posts - 25,936 through 25,950 (of 59,099 total)
Sean Lange (9/16/2013)
Jeff Moden (9/15/2013)
dwain.c (9/15/2013)
Jeff Moden (9/15/2013)
http://www.sqlservercentral.com/articles/comma+separated+list/71700/
For future posts, please see the article...
--Jeff Moden
Change is inevitable... Change for the better is not.
September 16, 2013 at 6:00 pm
siggemannen (9/16/2013)
SELECT MAX(salary)FROM t
WHERE salary < (SELECT MAX(salary) FROM t)
Apologies. I missed this. This would do it while meeting all of the expressed and implied restrictions.
--Jeff Moden
Change is inevitable... Change for the better is not.
September 16, 2013 at 5:57 pm
psingla (9/16/2013)
Jeff Moden (9/16/2013)
psingla (9/16/2013)
hopefully following will helphttp://pramodsingla.wordpress.com/category/interview-questions-2/
siggemannen (9/16/2013)
Or SELECT 'me' if you're a bit on the joking side...
Or:
SELECT MAX(salary)
FROM t
WHERE salary < (SELECT MAX(salary) FROM...
--Jeff Moden
Change is inevitable... Change for the better is not.
September 16, 2013 at 5:48 pm
psingla (9/16/2013)
hopefully following will helphttp://pramodsingla.wordpress.com/category/interview-questions-2/
siggemannen (9/16/2013)
DENSE_RANK should do it π
Neither of the proposed solutions meet the restrictions posed by the OP.
--Jeff Moden
Change is inevitable... Change for the better is not.
September 16, 2013 at 7:48 am
karunakar2351 (9/16/2013)
Could anyone know how to write the query fro fetching the second highest salary without using top, rowcount and rank keywords?
Why the strange restrictions?
--Jeff Moden
Change is inevitable... Change for the better is not.
September 16, 2013 at 7:46 am
Greg Edwards-268690 (9/16/2013)
Hope those in Colorado are doing OK.Floods are so devastating.
Especially when in areas you'd never expect them, and not related to spring run off.
My prayers are with you.
Ditto...
--Jeff Moden
Change is inevitable... Change for the better is not.
September 16, 2013 at 7:21 am
Oracle765 (9/15/2013)
ok thanks for the update, the query works but yes I agree, i will speak to the powers that be, thanks again all
You could also make a persisted calculated...
--Jeff Moden
Change is inevitable... Change for the better is not.
September 15, 2013 at 10:58 pm
What are you calling "whitespace"? Precisely what is in the variable when you get the error? Is it a NULL?
--Jeff Moden
Change is inevitable... Change for the better is not.
September 15, 2013 at 8:42 pm
dwain.c (9/15/2013)
Jeff Moden (9/15/2013)
http://www.sqlservercentral.com/articles/comma+separated+list/71700/
For future posts, please see the article at the first link...
--Jeff Moden
Change is inevitable... Change for the better is not.
September 15, 2013 at 8:35 pm
Trestire (9/13/2013)
<1|458|test|q><2|789|test2|s><5|567|test3|p>
First I've to extract the strings between < and >
like: 1|458|test|q 2|789|test2|s 5|567|test3|p
after that I've to split the the pipes: 1 458...
--Jeff Moden
Change is inevitable... Change for the better is not.
September 15, 2013 at 8:30 pm
Erland Sommarskog (9/15/2013)
Jeff Moden (9/15/2013)
Doesn't work, Erland. Consider a baby born on 12/31 of some year and using your code the next day.
In that case, there is some other...
--Jeff Moden
Change is inevitable... Change for the better is not.
September 15, 2013 at 5:16 pm
Erland Sommarskog (9/14/2013)
datediff(YEAR, BirthDate, getdate())
Doesn't work, Erland. Consider a baby born on 12/31 of some year and using your code the next day.
--Jeff Moden
Change is inevitable... Change for the better is not.
September 15, 2013 at 1:47 pm
With the idea of "teaching a man to fish" in full swing, please see the following article.
http://www.sqlservercentral.com/articles/comma+separated+list/71700/
For future posts, please see the article at the first link in "Helpful Links"...
--Jeff Moden
Change is inevitable... Change for the better is not.
September 15, 2013 at 1:44 pm
Ok, here we go. First, we need some test data. I normally test functions with a million rows of data to ensure scalability so hereβs a million row...
--Jeff Moden
Change is inevitable... Change for the better is not.
September 15, 2013 at 10:21 am
Sorry... deleted this post. I made a testing error. I'll be back.
--Jeff Moden
Change is inevitable... Change for the better is not.
September 14, 2013 at 9:18 pm
Viewing 15 posts - 25,936 through 25,950 (of 59,099 total)