Viewing 15 posts - 691 through 705 (of 3,957 total)
Lynn Pettis (3/6/2014)
wendy elizabeth (3/6/2014)
;WITH rCust AS ( SELECT...
March 6, 2014 at 6:06 pm
Sean Lange (3/6/2014)
select * from SomeTable;;;;;;;;;;;;;;;;;;;;;;;
That is the SQL equivalent of "you're terminated sucker!" 😛
March 6, 2014 at 6:04 pm
Excuse me from horning in here, but ROW_NUMBER() is overkill for this:
WITH SampleData (m,d) AS
(
select 'MachineA', '1/1/2008'
union all select 'MachineA', '1/3/2008'
...
March 6, 2014 at 5:59 pm
There's no reason to call DelimitedSplit8K twice, even if it is super-efficient (bless its heart):
WITH SampleData (s) AS
(
SELECT 'XYZ00001|Test_b|XYZ00002|Test_a|XYZ00003|Test_c'
)
SELECT s
,Col1=MAX(CASE WHEN ItemNumber%2...
March 6, 2014 at 5:54 pm
ScottPletcher (3/6/2014)
select cast(original_amount/2 +...
March 6, 2014 at 5:47 pm
TomThomson (3/6/2014)
Koen Verbeeck (3/6/2014)
MysteryJimbo (3/6/2014)
Koen Verbeeck (3/5/2014)
Pfff, than you have never been in Belgium before 😀
If we wouldn't be having the most traffic jam congested cities in the world, you...
March 6, 2014 at 5:41 pm
SQLRNNR (3/6/2014)
dwain.c (3/5/2014)
WITH...
March 6, 2014 at 5:31 pm
ChrisM@Work (3/6/2014)
dwain.c (3/4/2014)
ChrisM@Work (3/4/2014)
SELECT DATEDIFF(dd,0,GETDATE())-1
SELECT DATEADD(dd,DATEDIFF(dd,0,GETDATE())-1,0)
SELECT DATEADD(hh,18,DATEADD(dd,DATEDIFF(dd,0,GETDATE())-1,0))
Use q3. q1 and q2 help explain the algorithm.
I can do it with just two date function calls:
SELECT DATEADD(dd,DATEDIFF(dd,0,GETDATE())-1,'18:00')
I can also name that tune...
March 6, 2014 at 4:09 am
OK thanks. My head was spinning like Linda Blair's in The Exorcist trying to work out the possibilities. 😛
March 6, 2014 at 4:08 am
Hi All,
Maybe I'm too late to the party but I can add a bit of value here.
I recently did some testing of this in SQL 2012 (where there is a...
March 5, 2014 at 6:19 pm
Insert into Table 2 the results from this query:
WITH SampleData (D1, D2, D3, D4, D5) AS
(
SELECT 1, 4, 4, 2, 3
)
SELECT D1=MAX(CASE WHEN rn1=1 THEN D...
March 5, 2014 at 6:04 pm
Maybe this is a silly question but:
select Person
, OrderingKey = row_number() over (order by Person)
from #OrderingTest
order by row_number() over (order by Person) desc
What's the difference between...
March 5, 2014 at 5:54 pm
This could be done in a possibly more general fashion using DelimitedSplit8K but if you've only got 1 or 2 hyphens, you can also do it like this:
WITH SampleData (OrderNo)...
March 5, 2014 at 5:44 pm
I don't know anything about fuzzy grouping in SSIS but doesn't this do what you want?
WITH SampleData (key1, key2) AS
(
SELECT 64794, 2600014
UNION...
March 5, 2014 at 5:25 pm
louie1487 78804 (3/5/2014)
March 5, 2014 at 5:07 pm
Viewing 15 posts - 691 through 705 (of 3,957 total)