Viewing 12 posts - 1 through 13 (of 13 total)
I've changed data with this it is no good. Logic must be the same for all options
Try your solution with this data
INSERT INTO @test-2 VALUES
(1,2010001,'20150101','xxx',0, 30),
(2,2010001,'20150201','yyy',70, 0 ),
(3,2010001,'20150301','kkk',0, 60...
December 4, 2015 at 2:10 pm
View fourth answer and tell me your opinion
September 23, 2015 at 2:15 pm
What do you think about this:
DECLARE @t1 TABLE (
CODE nvarchar(20),
COLUMN1 numeric(18, 2),
COLUMN2 numeric(18, 2)
)
INSERT INTO @t1 (CODE, COLUMN1, COLUMN2)
VALUES ('432', 0,...
September 23, 2015 at 12:00 pm
I have update schema and i upload image with my desire result. I realized I need this result.
CREATE TABLE #NONAMETABLE(
sinGroup NVARCHAR(10)
,column1 INT
,column2...
September 14, 2015 at 4:23 pm
No, this is my starting point:
CREATE TABLE #NONAMETABLE(
ID INT
,column1 INT
,column2 int
);
INSERT INTO #NONAMETABLE(ID,column1,column2) VALUES
(1,100.00,40)
;
drop table #NONAMETABLE
September 14, 2015 at 3:41 pm
You need to do something like this
Select a,b,c from x
union all -- ALL doesn't filter dups and is faster
Select d, e, 'c' as f from y
September 8, 2015 at 6:24 am
Thank you very much!
September 7, 2015 at 6:58 am
Yes this is good. But what if i have input data in first column without '-'. Like this
CREATE TABLE #accounts (
AccountCode NVARCHAR(10),
...
September 7, 2015 at 6:20 am
I have edit my question.
I looked grouping set and I wrote this..
with data as (
select ACCOUNTCODE, substring(ACCOUNTCODE, 1, len(ACCOUNTCODE) - 1) as Prefix, accountName, Total...
September 7, 2015 at 4:36 am
I have edit my question
September 6, 2015 at 4:41 pm
Viewing 12 posts - 1 through 13 (of 13 total)