Viewing 15 posts - 5,326 through 5,340 (of 10,144 total)
;WITH SampleData AS (
SELECT CId = 1, CCId = 'a', CCount = 3, totalCount = 6 UNION ALL
SELECT 1, 'a', 3, 6 UNION ALL
SELECT 1, 'b', 3, 6 UNION ALL
SELECT...
January 16, 2013 at 9:22 am
Can you write a SELECT which returns the rows you want to copy? If not, what's the date range which identifies rows to copy? This is trivial, is it homework?
January 16, 2013 at 6:54 am
You may find this modification easier to work with:
SELECT
x.MonthNo,
x.[Year],
x.[Month],
COUNT(doclinkid) as Registered, -- is this correct?
COUNT(DISTINCT doclinkid) as Registered, -- OR is this correct?
SUM(x.Finalised) as Finalised,
COUNT(*) -...
January 16, 2013 at 1:53 am
wolfkillj (1/15/2013)
dwain.c (1/15/2013)
wolfkillj (1/15/2013)
January 16, 2013 at 1:02 am
Alan.B (1/14/2013)
Jeff Moden (1/10/2013)
Alan.B (1/10/2013)
This morning before work for example, after a lot of effort, I finally figured out how to get the Levenshtein Edit Distance between 2 strings without...
January 15, 2013 at 6:29 am
pwalter83 (1/15/2013)
ChrisM@Work (1/11/2013)
Hi PaulI'll try to have a look over the weekend. Meantime, it's the last 5 mins of my last day here - and it's BEERTIME!
Cheers
ChrisM
Hi Chris,
I am still...
January 15, 2013 at 3:32 am
SELECT 'D' + LEFT(CAST(num AS VARCHAR(4))+'0000',4)
FROM abc
SELECT ISNULL('D' + LEFT(CAST(NULLIF(num,0) AS VARCHAR(4))+'0000',4),'0')
FROM abc
January 15, 2013 at 1:35 am
sej2008 (1/15/2013)
Select TOP 50 percent * from Tablename as it is not giving exact 50 percent in my result set .how it...
January 15, 2013 at 1:24 am
Hi Paul
I'll try to have a look over the weekend. Meantime, it's the last 5 mins of my last day here - and it's BEERTIME!
Cheers
ChrisM
January 11, 2013 at 9:40 am
pwalter83 (1/11/2013)
ChrisM@Work (1/11/2013)
SELECT SUM(teu) AS TEU
FROM NCV_BL ncv
JOIN MG_VSLVOY_HEADER vh
ON ncv.saisan_VESSEL_CD = vh.VESSEL_CD
AND ncv.saisan_VOYAGE_CD = vh.VOYAGE_NUM
AND ncv.saisan_LEG_CD = vh.LEG_CD
JOIN MG_VSLVOY_PORT_CONTROL vpc
ON...
January 11, 2013 at 8:50 am
I think this better fits the spec:
SELECT SUM(teu) AS TEU
FROM NCV_BL ncv
JOIN MG_VSLVOY_HEADER vh
ON ncv.saisan_VESSEL_CD = vh.VESSEL_CD
AND ncv.saisan_VOYAGE_CD = vh.VOYAGE_NUM
AND ncv.saisan_LEG_CD = vh.LEG_CD
JOIN MG_VSLVOY_PORT_CONTROL vpc
ON vh.VSLVOY_HEADER_ID =...
January 11, 2013 at 8:23 am
Why do you need to join to the other tables if they aren't contributing to the query, either as output or as a filter?
January 11, 2013 at 8:06 am
pwalter83 (1/11/2013)
ChrisM@Work (1/11/2013)
Put that table first in the FROM list and inner join the other tables.
Comment out all of the joins to...
January 11, 2013 at 7:30 am
Paul, which table contains column 'teu'? (and 'BL_ID')
Put that table first in the FROM list and inner join the other tables.
Comment out all of the joins to the other...
January 11, 2013 at 7:12 am
Composable dml:
INSERT INTO DataStaging_Archive (URN, DateProcessed, AnotherColumn, LastRemainingColumn)
SELECT URN, DateProcessed, AnotherColumn, LastRemainingColumn
FROM (
DELETE TOP (@Batchsize) -- note: no order by, rows picked at random, see BOL
FROM DataStaging ds
...
January 9, 2013 at 8:46 am
Viewing 15 posts - 5,326 through 5,340 (of 10,144 total)