Viewing 15 posts - 46 through 60 (of 682 total)
Here's another one to add to the pile...
; WITH cteRankedAddresses AS (
SELECT AccountNum, MAX(DM_Source_ID) AS MaxDM_Source_ID, Address,
ROW_NUMBER() OVER...
July 22, 2008 at 7:50 am
Like this?
...order by case when PageId > 0 then 1 end desc, StatusID, PageID
July 22, 2008 at 4:52 am
Hi Chris
Yes, you're right. I was going by the wording by in the examples post, but reading back I see this is needed for each account number. My apologies.
July 22, 2008 at 4:45 am
Possibly I'm oversimplifying, but the following meets my understanding of the requirements...
select top 1 Address from myTable group by Address order by count(*) desc
July 22, 2008 at 3:00 am
But is there a way to do it that isn't a triangular join?
Only by upgrading to 2005...
July 21, 2008 at 9:33 am
Hehe - lowly indeed. There's your problem.
Some reading material...
http://sqlblogcasts.com/blogs/jonsayce/archive/2007/12/03/using-where-not-in-select-with-nulls.aspx
http://drsql.spaces.live.com/blog/cns%2180677FB08B3162E4%21777.entry
July 21, 2008 at 8:45 am
There's not a null userid in dbo.users, is there?
July 21, 2008 at 8:15 am
Something along these lines...
select convert(varchar(8), getdate(), 112) + '_' +
replace(substring(convert(varchar(20), getdate(), 113), 13, 8), ':', '-')
July 21, 2008 at 8:10 am
Here's one way...
select * from @mytable a where 2 >
(select count(*) from @mytable where GroupKey = a.GroupKey and field1 < a.field1)
July 21, 2008 at 8:04 am
b_boy (7/18/2008)
RalphYour a life saver thanks very much!!!
Ralph?
July 18, 2008 at 4:22 am
The error is because you need square brackets around 'Extended Price' on line 4.
SUM([Extended Price]) AS [Total Extended Price],
July 18, 2008 at 3:49 am
Viewing 15 posts - 46 through 60 (of 682 total)