Viewing 15 posts - 1,636 through 1,650 (of 5,590 total)
Gianluca Sartori (3/25/2011)
Yes, now translate it into T-SQL, set-based if possible. 🙂 Ugh!
One made-to-order, set-based solution, utilizing the pseudo-cursor (aka Quirky Update):
(please READ AND UNDERSTAND the article mentioned below before...
March 25, 2011 at 9:43 am
What I'd really like to understand is the business requirements for producing such a sort...
Currently, all I can think of is a ...
(I just can't bring myself to say it...
March 25, 2011 at 8:39 am
From what I see....
Fill up a "group queue" with two groups, in order of the routeCode column.
Return one row from each group, in order of the routePos column.
If one of...
March 25, 2011 at 8:13 am
For those willing to play with this, here is the OPs sample data from the first post in readily consumable format.
DECLARE @test-2 TABLE (
customerId INTEGER,
routeCode INTEGER,
...
March 25, 2011 at 7:52 am
Need an app that adds an "unused" folder to your system, takes a screen shot of the desktop, moves all icons to the unused folder, and replaces the background with...
March 25, 2011 at 7:45 am
GSquared (3/25/2011)
The CTE version will work. My first instinct was a simple Inner Join between two iterations of the table.
Like so...
SELECT t1.*,
...
March 25, 2011 at 7:34 am
How's this?
WITH cte AS
(
SELECT *
FROM PS_TestForOnline
WHERE diag = 'D12.3'
AND position > 1
)
SELECT t1.*,
diag2 = cte.diag,...
March 25, 2011 at 7:16 am

Congrats Gail on 25000! (And I think that this is the first major milestone on The Thread reached by a non-US Threadizen! Congrats again!)
Edit: Added image. Thanks Gianluca for the...
March 25, 2011 at 6:56 am
Koen Verbeeck (3/25/2011)
Or that Microsoft has traded MS Access for MySQL. Because who needs Access right? 🙂
Hmm, I like that. It passes the first test... believability.
March 25, 2011 at 6:47 am
Almost at 25,000 posts here on The Thread! At today's rate, we'll hit it tonight.
Edit: 36 posts to go. (Watch Alvin post the next 36 messages...)
March 24, 2011 at 4:37 pm
CirquedeSQLeil (3/24/2011)
As far as bad drivers goes, Las Vegas takes all of the bad habits from all over the country (including many from overseas) and combines them into one place.
Same...
March 24, 2011 at 4:29 pm
It looks like you're trying to get a list of all of the dates in a calendar week, excluding weekends (include Jan 25, but not Jan 29/30)?
Here's some code that...
March 24, 2011 at 8:50 am
Jeff Moden (3/23/2011)
parthi-1705 (3/23/2011)
Try this,CHARINDEX will help u
CREATE TABLE #abc_tmp
(Path nvarchar(850))
insert into #abc_tmp values('rptclientrifvdistrictgrantstatuschangelog_MillmanR_9dfb3dfa-081b-48d1-8bbf-81361bbd9cb9')
insert into #abc_tmp values('rptclientrifvdistrictgrantstatuschangelog_MeiA_e472f742-c6a3-4a70-822e-1c5417efb293')
insert into #abc_tmp values ('rptclientrifvglobalgrantproposalbytrackingnumber_BateyK_23eafa59-e222-462d-a08c-27ed8131c274')
Select SUBSTRING(Path,0, CHARINDEX('_',Path) ), * from #abc_tmp
DROP TABLE #abc_tmp
VERY...
March 24, 2011 at 8:22 am
Craig Farrell (3/23/2011)
opc.three (3/23/2011)
Another technique I have found useful is to use the EXEC...AT expression because it let's you use a variable and you can still pipe the...
March 24, 2011 at 8:13 am
Pam,
Actually, I think you wrote a pretty good query.
March 23, 2011 at 1:58 pm
Viewing 15 posts - 1,636 through 1,650 (of 5,590 total)