Viewing 15 posts - 1,171 through 1,185 (of 3,544 total)
What is the definition of the input parameter?
At a guess
If input parameter TRADE is singular then
CASE WHEN MG_BOOKING.TRADE IS NULL THEN CASE WHEN MG_BILL.TRADE = @TRADE THEN 1
...
Far away is close at hand in the images of elsewhere.
Anon.
March 9, 2011 at 8:11 am
My solution for what it's worth 😉
SELECTIDENTITY(INT,1,1) AS [RowNum],
PartNumber,
Factor
INTO#MyHead
FROMdbo.XlsDump
ORDER BY PartNumber, Factor
SELECT IDENTITY(INT,0,1) AS [GroupNumber],0 AS [RowNum]
INTO #MyHead2
INSERT #MyHead2 (RowNum)
SELECT a.RowNum
FROM #MyHead a
LEFT JOIN #MyHead n ON n.RowNum=a.RowNum+1
WHERE NOT (a.Factor=n.Factor)
OR...
Far away is close at hand in the images of elsewhere.
Anon.
March 9, 2011 at 7:49 am
SQLkiwi (3/7/2011)
Gianluca Sartori (3/7/2011)
SQLkiwi (3/4/2011)
Exciting day - just had my first Simple Talk article published:http://www.simple-talk.com/sql/learn-sql-server/understanding-and-using-parallelism-in-sql-server/
Great job, Paul! Outstanding, as usual.
Now there's a chance that a poor n00b like me can...
Far away is close at hand in the images of elsewhere.
Anon.
March 7, 2011 at 9:06 am
Ian Scarlett (2/24/2011)
SQLkiwi (2/24/2011)
David Benoit (2/24/2011)
I remember when I took my first programming class, Pascal (Turbo actually)...I did a term using Turbo Pascal at University too.
OMG, that makes me feel...
Far away is close at hand in the images of elsewhere.
Anon.
February 24, 2011 at 9:06 am
oecus
Far away is close at hand in the images of elsewhere.
Anon.
February 23, 2011 at 7:06 am
GSquared (2/18/2011)
David Burrows (2/18/2011)
string strsql = "";strsql += " Select '' AS [CustomerId],' ---Select Customer --- ' AS [CompanyName] ";
strsql += " Union Select CustomerId, CompanyName ";
strsql +=...
Far away is close at hand in the images of elsewhere.
Anon.
February 18, 2011 at 7:39 am
Gianluca Sartori (2/18/2011)
If I didn't post on THE THREAD a "Lennie alert" nobody would have noticed, Lennie would have got his answer and...
Far away is close at hand in the images of elsewhere.
Anon.
February 18, 2011 at 7:14 am
string strsql = "";
strsql += " Select '' AS [CustomerId],' ---Select Customer --- ' AS [CompanyName] ";
strsql += " Union Select CustomerId, CompanyName ";
strsql += " From testCustomers...
Far away is close at hand in the images of elsewhere.
Anon.
February 18, 2011 at 4:48 am
Mine says it all :w00t:
Far away is close at hand in the images of elsewhere.
Anon.
February 16, 2011 at 6:43 am
Or even this
SELECT RegionName,
AVG(CASE WHEN Month_Value = 7 THEN Answer END) AS [PreviousMonthAns],
AVG(CASE WHEN Month_Value = 8 THEN Answer END) AS [Answer]
FROM Mst_Location A
JOIN Voc_Trans_Details D...
Far away is close at hand in the images of elsewhere.
Anon.
January 31, 2011 at 7:20 am
This probably better than the join
SELECT RegionName,
CASE WHEN Month_Value = 7 THEN Answer END AS [PreviousMonthAns],
CASE WHEN Month_Value = 8 THEN Answer END AS [Answer]
FROM x
GROUP...
Far away is close at hand in the images of elsewhere.
Anon.
January 31, 2011 at 7:16 am
WITH x (RegionName, Month_Value, Answer) AS (
SELECT B.RegionName, D.Month_Value, AVG(D.Answer) AS [Answer]
FROM Mst_Location A
JOIN Voc_Trans_Details D ON A.LocationID = D.Location_Id
JOIN Master_Map_RegionWithLocation C ON A.LocationID = C.LocationID
JOIN...
Far away is close at hand in the images of elsewhere.
Anon.
January 31, 2011 at 7:01 am
My query had a problem and for the record I post a revised version
Based on a million rows of my test data
'1,2,3,"abc,def",4,5,"ghi,jkl",6,7,"8,"""",x,y"""",",9'
on my desktop, it took 7 iterations taking...
Far away is close at hand in the images of elsewhere.
Anon.
January 25, 2011 at 5:21 am
This solution uses a temp table to add a unique id to the data
It needs to be repeated until no updates are left
(sorry about the short names but it was...
Far away is close at hand in the images of elsewhere.
Anon.
January 24, 2011 at 2:14 pm
Craig Farrell (1/24/2011)
PatIndex('%"%,%"%',THE_LINE)),
-- with this:
PatIndex('%,"%,%",%',THE_LINE)),
Note where the additional commas are to detect beginning and ending doublequotes.
I may have an alternative for you but it's going to be a busy...
Far away is close at hand in the images of elsewhere.
Anon.
January 24, 2011 at 11:53 am
Viewing 15 posts - 1,171 through 1,185 (of 3,544 total)