Viewing 15 posts - 196 through 210 (of 1,923 total)
This?
begin tran
; with cte as
(
select * , rn = ROW_NUMBER() over(PARTITION by DateValue ,Value order by DateValue) from #tableone
)
, DeleteCount AS
(
select DateValue...
April 24, 2012 at 10:58 am
Unnati,
I have seen you on another thread and i remember asking you to provide DDL so that people can jump on the thread without wasting yours as well as...
April 23, 2012 at 6:08 pm
I am having hard time visualizing how your expected result looks like.. Can you proivde a visual example on how it should be?
April 23, 2012 at 3:16 pm
Polka, try this:
declare @string varchar(200) = '\Beverages\Soda Pop\Mountain Dew'
select @string = STUFF( @string , 1 , CHARINDEX('\',@string,CHARINDEX('\',@string)+1),'')
April 23, 2012 at 12:01 pm
If are you 100% sure that the values for name will alwys be 'joe' , 'bill' and 'rob' (i sense that this is sample data, and your original data will...
April 22, 2012 at 10:30 pm
Given your explanation, do u want to see 2,'a' in your expected reslt?
April 20, 2012 at 1:01 pm
As sean, points out, without defining the order of the rows, it is impossible to group the "islands"
To show u a sample of how it will work with the defined...
April 20, 2012 at 12:40 pm
This?
; WITH sampledata(OrderNumber,OrderDetail,ItemCategory) AS
(
SELECT 1,1,'A'
UNION ALL SELECT 1,2,'A'
UNION ALL SELECT 1,3,'L'
UNION ALL SELECT 2,1,'A'
UNION ALL SELECT 3,1,'N'
UNION ALL SELECT 3,2,'R'
UNION ALL SELECT 3,3,'Y'
),
GroupsWithA (OrderNumber ,ItemCategoryCt...
April 20, 2012 at 12:17 pm
Possible. here it is
if OBJECT_ID('tempdb..#temp') is not null
drop table #temp
create table #temp (size int, nameofitem varchar(1) , price int)
insert into #temp
...
April 20, 2012 at 3:38 am
Cadavre (4/20/2012)
I've been struggling to come up with any algorithms for a design issue this morning which is probably further proof of needing coffee.
And its deep into the night, 2...
April 20, 2012 at 2:55 am
Cadavre (4/20/2012)
Vedran Kesegic (4/19/2012)
April 20, 2012 at 2:35 am
Vedran Kesegic (4/19/2012)
April 19, 2012 at 11:49 pm
Vedran Kesegic (4/19/2012)
So, the same thing without CTE:
SELECT it.*
FROM
(SELECT...
April 19, 2012 at 4:57 pm
Need more clarification 🙂
SELECT DATEADD(MM,-12,GETDATE())
give you 2011-04-19 11:12:01.653
Now if you had a row with April 2011, should that be neglected or should that be included?
April 19, 2012 at 12:13 pm
12 months back, from today will include months in 2011 also. So you really cant base 12 months on the date column (which contains only years) with the data you...
April 19, 2012 at 12:02 pm
Viewing 15 posts - 196 through 210 (of 1,923 total)