Viewing 15 posts - 106 through 120 (of 683 total)
Jeff Moden (5/12/2008)
Nicely done, Ryan.
Thanks Jeff 🙂
May 12, 2008 at 4:51 am
I guess you could 'pad' that first number before you do your comparisons...
declare @t table (warehouse int, [From] varchar(10), [To] varchar(10))
insert @t
...
May 12, 2008 at 4:12 am
What output would you want for the example you gave?
May 12, 2008 at 3:41 am
May 12, 2008 at 3:39 am
Perhaps you're trying to do this?
Select
CASE
WHEN Col1 = 'Y' THEN 'Col1'
WHEN Col2 = 'Y' THEN 'Col2'
WHEN Col3...
May 12, 2008 at 2:29 am
If you add an index (clustered or not) to #sparseData...
create clustered index ix_sd1 on #sparseData (dateId)
...the cross apply has the best performance for the small dataset you give (at least...
May 12, 2008 at 2:26 am
Another option:
select * from #drivingTable a cross apply
(select top 1 * from #sparseData where dateId <= a.dateid order by dateId desc) b
May 12, 2008 at 2:10 am
Michael Valentine Jones (5/9/2008)
Simply put, this approach is always a disaster.
I love it! 😀
May 9, 2008 at 11:23 am
Perhaps you should change the title to walking down the tree 😀
May 9, 2008 at 11:09 am
If I've understood you correctly, here's one idea...
; with
a as (select *, case when charindex('.', Proj_ID) > 0 then left(Proj_ID, len(Proj_ID) - charindex('.', reverse(Proj_ID))) end as...
May 9, 2008 at 11:06 am
srienstr (5/9/2008)
May 9, 2008 at 10:08 am
shahab (5/9/2008)
ts_date is just a date field. for tangible sold.
The point was that you've referred to it in your rules, but it's not in your structure (at least not in...
May 9, 2008 at 8:39 am
Well, here's one idea of the type of thing you could do...
-- Structure and Data
CREATE TABLE [dbo].[AlDate](
[EMPL_ID] [varchar](12) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
...
May 9, 2008 at 7:59 am
Viewing 15 posts - 106 through 120 (of 683 total)