Viewing 15 posts - 886 through 900 (of 2,458 total)
Nice work, well done sir. A few things to note:
First a couple of ticky-tacky things that aren't a huge deal but worth mentioning...
You may want to consider using a...
-- Itzik Ben-Gan 2001
March 29, 2016 at 10:46 pm
If you had a calendar table available the you can do it like this (note my code and comments):
USE tempdb
GO
-- Simplified calendar table with only the columns you need
IF OBJECT_ID('dbo.calendar')...
-- Itzik Ben-Gan 2001
March 29, 2016 at 9:51 pm
Phil Parkin (3/29/2016)
Alan.B (3/29/2016)
You would use AND.
SELECT vend_id, prod_id, pro_priceFROM products
WHERE prod_price <=5
AND vend_id IN (1001, 1002);
Disagree. This requires an OR.
select a from b where condition1
union (should probably be union...
-- Itzik Ben-Gan 2001
March 29, 2016 at 10:41 am
You would use AND.
SELECT vend_id, prod_id, pro_price
FROM products
WHERE prod_price <=5
AND vend_id IN (1001, 1002);
-- Itzik Ben-Gan 2001
March 29, 2016 at 10:31 am
Can you include some DDL and sample data?
-- Itzik Ben-Gan 2001
March 29, 2016 at 10:29 am
SQL Guy 1 (3/28/2016)
And about the value for threshold for parallelism, you recommend to do some research. Can I ask what should I check for it?
I am not an...
-- Itzik Ben-Gan 2001
March 28, 2016 at 2:39 pm
SQL Guy 1 (3/28/2016)
Estimated execution plan inserts...
-- Itzik Ben-Gan 2001
March 28, 2016 at 12:18 pm
Jacob Wilkins (3/28/2016)
DesNorton (3/28/2016)
-- Itzik Ben-Gan 2001
March 28, 2016 at 9:52 am
Great article Andy, well done.
-- Itzik Ben-Gan 2001
March 28, 2016 at 9:18 am
Jon.Morisi (3/25/2016)
I bet there's only 2 to pick from, if you can even find one. :hehe: BI books in general have been hard to come by since 2008...
Yep.
-- Itzik Ben-Gan 2001
March 26, 2016 at 11:16 am
Jacob Wilkins (3/25/2016)
Sachin Nandanwar (3/25/2016)
...But again it looks to cumbersome with all those conditions in the CASE expression.Your original solution is more subtle.
Your version doesn't have to be that complicated.
It...
-- Itzik Ben-Gan 2001
March 25, 2016 at 11:28 am
Anyone want to take a stab at this. Essentially the OP needs a csv splitter that handles text qualifiers; Eirikur Eiriksson's RFC-4180 compliant splitter from this article: This article[/url] would...
-- Itzik Ben-Gan 2001
March 25, 2016 at 10:31 am
Are you really on SQL Server 2008? If you were using SQL 2012 this article would get you 90% there:
http://www.sqlservercentral.com/articles/SQL+Server+2012/106903/%5B/url%5D
I'm going to play around with a couple ideas and...
-- Itzik Ben-Gan 2001
March 25, 2016 at 9:25 am
John Mitchell-245523 (3/24/2016)
Those somewhat contrived requirements make this sound like a homework assignment. Why can't you create any temp tables or new procedures?John
This is actually a common business requirement....
-- Itzik Ben-Gan 2001
March 24, 2016 at 9:50 am
Provided that the rank_pos is sequential and there are no gaps you use LEAD like this:
SELECT t.Score, Rank_pos = ISNULL(t.Rank_pos,X.Rank_pos+1)
FROM
(
SELECT score, Rank_pos, xx = LEAD(Score,1,1) OVER...
-- Itzik Ben-Gan 2001
March 24, 2016 at 9:37 am
Viewing 15 posts - 886 through 900 (of 2,458 total)