Viewing 15 posts - 1 through 15 (of 17 total)
the method above is useful since its dynamic, but i wanted to show you a more manual way of doing it as well.
CREATE taBLE #TEMP
(
id INT,
fk_id INT,
...
May 2, 2013 at 3:36 pm
It bothered me now.
So i had to come up with a way to, but I would prolly choose the first one opver my own.
DECLARE @LastValue varchar(100)
declare @string varchar (100)
set...
March 25, 2013 at 11:12 am
Agreed, I am just being lazy :p
March 25, 2013 at 11:00 am
if you always know the len of the extnetion this should work as well without being so taxing.
declare @string varchar (100)
set @string = 'x:\folder1\folder2\folder3\test.txt'
select SUBSTRING(@string,1, LEN(@string)-8)
March 25, 2013 at 10:52 am
if you're working on a huge amount of data I think the most optimized way would be to use the row)number function. This allows you to partition the values you...
March 24, 2013 at 9:14 am
here you go broski!
CREATE Table #TEMP
(
id varchar(100),
MID VARCHAR(100)
)
INSERT INTO #TEMP
VALUES ('100',NULL),
('200',NULL),
('300',NULL),
('400',NULL),
('500',NULL)
UPDATE OP
SET MID = OL.id
FROM (SELECT LL.ROW_ID, LL.ID,LL.MID
FROM(
SELECT ROW_ID =ROW_NUMBER() OVER (order by ID),ID,MID
FROM #TEMP I)LL)OP
JOIN...
March 21, 2013 at 12:43 pm
I think maybe you're looking for something like this?
SELECT DISTINCT *
FROM(
SELECT * FROM #TableA
where Area IS NULL )LL
FULL OUTER JOIN #TableB CB ON LL.Area = cb.ColId
LEFT OUTER...
March 20, 2013 at 8:39 am
I must admit the guy who wrote the query qith the XML logic was an eye opener for me, I reallyed liked that method best. The way I have been...
March 19, 2013 at 1:50 pm
I would imagine your going to need to use the substring function as well as datepart function and possibly come CAST/COnvert functions in the mix. If you can supply a...
March 18, 2013 at 4:05 pm
tsk tsk.
I had some time after work to help ya out. Honestly the best way to go is dynamic sql. I gave you an explaination about piviot so you...
March 18, 2013 at 3:53 pm
It can get a little tedious typing out all the months so I only did Jan,Feb,March and Dec. A dynamic pivot would be usefully if you are uncertain of the...
March 17, 2013 at 6:49 pm
couldnt you copy the excel schema into a table form and sync up the rows and columns that way?
February 19, 2013 at 4:00 pm
I think this is what you're looking for.
Cheers.
declare @col_Str varchar(max) ,
@SQl_Query varchar(max);
WITH substitue as (Select Distinct Reason from paymentHistory )
--select @col_Str=isnull(@col_Str+',','')+reason from substitue;
select @col_Str=isnull(@col_Str+'],[','')+Reason from substitue
--select @col_Str=isnull(@col_Str+'],[','')+Reason from substitue
select @col_Str='['+@col_Str+']'
--select...
February 15, 2013 at 6:30 am
Thats how I would have done it.
Select TOP 1 COUNT
FROM(
select graph, sum(yesNo) as count
from graph where dataName = 'data1' group by graph)J
order by count desc
December 30, 2012 at 8:13 am
Im a bit lost with the desired output. are you only comparing the first two rows? should the desired output in the 225 provided the industry and category are...
December 19, 2012 at 7:31 pm
Viewing 15 posts - 1 through 15 (of 17 total)