Viewing 15 posts - 7,066 through 7,080 (of 8,731 total)
This explains the basics: http://bit.ly/1aKPF3N
January 30, 2014 at 1:19 pm
Jeff Moden (1/30/2014)
"JOCC BOOSTR" (pronounced "jock booster")Definition:
Justification Of Crap Code Based Only On Small Table Requirements
🙂
Everywhere
January 30, 2014 at 1:05 pm
I agree with Chris, you should try them.
However, you might note that No.1 is using a function so it's not SARGable and No.2 is using LIKE with no wildcards, so...
January 30, 2014 at 1:03 pm
A change to the function might be needed if the OP wants to include time offsets that don't use full hours as Venezuela which is UTC-04:30.
January 30, 2014 at 12:58 pm
Not yet, but I wouldn't continue to use them in current or future development.
January 30, 2014 at 11:46 am
To know what's happening, we need you to post DDL and sample data in a consumable format (insert into statements). The reason for this is that we can't see what...
January 30, 2014 at 11:17 am
What's wrong with you current query? It seems to work as expected. Maybe you're having problems with your WHERE clause, try using some parenthesis.
January 30, 2014 at 11:07 am
You're welcome. It was fun when I found numero and thought it was spanish but it was really italian. 😀
If you have any questions on how does it work, feel...
January 30, 2014 at 9:25 am
I'd say it depends on what you need because a table can't have 2 primary keys by definition. It's not about SQL Server, it's about relational theory.
January 30, 2014 at 9:20 am
Nevyn (1/30/2014)
Using the analytic functions...
I need a 2012 instance at work 😀
January 30, 2014 at 9:16 am
Here's an option you could use to create your groups.
;WITH Islands( Account, AStatus, SDate, grouper ) AS
(
SELECT Account,
AStatus,
SDate,
ROW_NUMBER() OVER( ORDER BY SDate) -
ROW_NUMBER() OVER( PARTITION BY AStatus ORDER...
January 30, 2014 at 9:05 am
Hi Alessandro,
Thank you for posting your sample data with DDL and insert statements.
This solution might solve your problem, at least it works as expected on the sample data.
WITH CTE AS(
SELECT...
January 30, 2014 at 8:41 am
Could you post DDL for the columns involved?
EDIT: I'm asking because data types might perform different one from another and it would end in a wrong solution.
January 29, 2014 at 4:31 pm
Hi Alex,
I was in a good mood and prepared the sample data, but I might not do it again, it's just to show you how it should be done.
I'm including...
January 29, 2014 at 3:47 pm
You're very welcome. I hope that you learned something from this and you fully understand how the solution works. Remember to comment the code as you feel necessary to avoid...
January 29, 2014 at 1:22 pm
Viewing 15 posts - 7,066 through 7,080 (of 8,731 total)