Viewing 15 posts - 406 through 420 (of 466 total)
;with SampleDataR as
(
select *, ROW_NUMBER() over (partition by title, subtitle order by value) rownum
from test12
)
select distinct title, subtitle,(
select value
+ case when s1.rownum = (select MAX(rownum) from SampleDataR where...
March 2, 2012 at 10:55 am
I have used for xml path to do a similar thing before.
;with SampleDataR as
(
select *, ROW_NUMBER() over (partition by ID order by Name) rownum
from #Temp
)
select distinct ID,(
select Name
+...
February 27, 2012 at 9:05 am
I'm sure there's 100 different ways to do this, most of which are better than my solution, but here it is anyways.
select j1.child
from job j1
where j1.parent in (
select j.parent
from sites...
February 23, 2012 at 10:37 am
If you only want the rows where the score is between 1 and 10, I would just replace you where statement with something like this.
WHERE score like '[1-9]' or score...
February 22, 2012 at 9:55 am
I guess I was wondering if there is some documentation on this behavior. What I found and posted wasn't very satisfying to me. I know it can be...
February 21, 2012 at 4:12 pm
ColdCoffee (2/21/2012)
This MSDN link has a lot of information on ISNUMERIC.Read them up!
And...
February 21, 2012 at 4:04 pm
ColdCoffee (2/20/2012)
DECLARE @Table TABLE
( UserID INT , Interested INT
, Interesting INT , Purchased INT )
INSERT INTO @Table (UserID ,Interested, Interesting,...
February 21, 2012 at 8:27 am
If they're all just 1 or 0 flags for each category, just use the SUM() function on each column to get the count that are interested, purchased, ect.
February 20, 2012 at 4:04 pm
select specialty, MIN(providerid)
from TestProviders
group by specialty
February 16, 2012 at 3:08 pm
If you are sure you want all the zips length greater than 5 then something like this should work.
update p
set p.zip = substring(p.zip, 1, 5)
from person p
where len(zip) > 5
You...
February 13, 2012 at 4:24 pm
sbarlow (2/13/2012)
If i run this select * from person WHERE len(zip) > 5 I get this result what I need is an update statement to remove the zeros134930000
134930000
134930000
134930000
134930000
134930000
134930000
134930000
134930000
134930000
134930000
134930000
134930000
Try
select substring(zip,...
February 13, 2012 at 4:16 pm
Are they all 9 digits long and all have 4 zeros at the end? If so,
substring(zip, 1, 5)
would work. If you post some code with some sample data...
February 13, 2012 at 4:09 pm
Ray K (2/13/2012)
So, the Seattle Mariners have started camp! I understand that other teams open camp this week as well!So, who's excited? :hehe:
The Cubs are tied for first place...
February 13, 2012 at 3:51 pm
Divine Flame (2/8/2012)
tototom (2/8/2012)
Finally after...
February 9, 2012 at 8:21 am
Ah, sorry about that. That and Howard's solution make sense now.
February 7, 2012 at 10:51 am
Viewing 15 posts - 406 through 420 (of 466 total)