Viewing 15 posts - 3,166 through 3,180 (of 10,144 total)
SELECT
a, -- column is in #TableA only
b, -- column is in #TableA only
c, -- column is in #TableA only
d, -- column is in both tables
e =...
July 8, 2014 at 3:17 am
The output columns of #header (and #body?) in this new post are completely different to earlier posts. Are you simply describing the data types of these columns or proposing a...
July 8, 2014 at 3:03 am
visu.viswanath (7/8/2014)
Is there any limitation for file size through query not from SSIS package.
it gives error message as
"server is not responding...
July 8, 2014 at 2:18 am
C-kweldude (7/7/2014)
...I have a column with integer records of 5 and 6 characters....
What datatype is the column? It's not clear if you are describing the datatype or the content.
July 8, 2014 at 1:59 am
Here's an alternative using APPLY:
SELECT s.Sheet_ID, s.Sheet_Month, s.Sheet_Year, s.Sheet_Period,
s.Date_Start, s.Date_End, s.Date_Submit, s.Date_Approved, s.PD,
s.Emp_ID, s.Dept_ID, s.Emp_Status, s.Comments, s.Supervisor_ID,
s.Sheet_Status, s.Submit_ID, s.Approve_ID,
TOTAL_Sheet = SUM(r.Record_Hours) OVER(PARTITION BY r.Sheet_ID),
sp1.Supervisor_Name,
sp2.Submit_Name,
sp2.Submit_Email,
sp3.Approve_Name,
sp3.Approve_Email,
DAY(r.Record_Date)...
July 7, 2014 at 9:29 am
That's why I put the query which had the most columns first in the UNION. The NULL placeholders in query 2 don't need datatyping. You only have to investigate the...
July 7, 2014 at 8:02 am
hoseam (7/7/2014)
So what about the data types from #Header and #Body since we going to Union both queries?
Quite. I could guess them for you, or you could investigate what they...
July 7, 2014 at 7:46 am
Cadavre (7/7/2014)
ChrisM@Work (7/7/2014)
SELECT TOP 1 *FROM (
SELECT *, rn = ROW_NUMBER() OVER(ORDER BY c1)
FROM #Test
) d
ORDER BY CASE WHEN c3 = 1 THEN 0 ELSE 1 END, rn
Why does it...
July 7, 2014 at 7:29 am
SELECT mc.COUNTRY_DSC, alias.POL_LOCATION_CD, alias.TEU, mcc.TYPE_CD
FROM MG_COUNTRY mc
LEFT JOIN (VALUES
('Germany'),('Austria'),('Netherlands'),('Belgium'),('France'),
('Ireland'),('Sweden'),('Finland'),('Denmark'),('Norway')
) d (COUNTRY_DSC)
ON d.COUNTRY_DSC = mc.COUNTRY_DSC
LEFT JOIN MG_OFFICE mo
ON mo.COUNTRY_CD = mc.COUNTRY_CD
LEFT JOIN MG_BOOKING_DATASET mgd
on mgd.BOOKING_OFFICE_CD = mo.OFFICE_CD
AND alias.Booking_status_cd in...
July 7, 2014 at 5:42 am
SELECT d.COUNTRY_DSC, alias.POL_LOCATION_CD, alias.TEU, mcc.TYPE_CD
FROM (VALUES
('Germany'),('Austria'),('Netherlands'),('Belgium'),('France'),
('Ireland'),('Sweden'),('Finland'),('Denmark'),('Norway')
) d (COUNTRY_DSC)
LEFT JOIN MG_COUNTRY mc
ON mc.COUNTRY_DSC = d.COUNTRY_DSC
LEFT JOIN MG_OFFICE mo
ON mo.COUNTRY_CD = mc.COUNTRY_CD
LEFT JOIN MG_BOOKING_DATASET mgd
on mgd.BOOKING_OFFICE_CD = mo.OFFICE_CD
AND alias.Booking_status_cd in...
July 7, 2014 at 4:59 am
SELECT alias.COUNTRY_DSC, alias.POL_LOCATION_CD, alias.TEU, mcc.TYPE_CD
FROM MG_COUNTRY mc
LEFT join MG_OFFICE mo
ON mo.COUNTRY_CD = mc.COUNTRY_CD
LEFT JOIN MG_BOOKING_DATASET mgd
on mgd.BOOKING_OFFICE_CD = mo.OFFICE_CD
AND alias.Booking_status_cd in ('H','F','I','P')
LEFT join MG_BOOKING_EQUIPMENT_REQ ber
on mgd.BOOKING_ID = ber.BOOKING_ID
LEFT join MG_CONTAINER_CODE...
July 7, 2014 at 4:42 am
SELECT TOP 1 *
FROM (
SELECT *, rn = ROW_NUMBER() OVER(ORDER BY c1)
FROM #Test
) d
ORDER BY CASE WHEN c3 = 1 THEN 0 ELSE 1 END, rn
July 7, 2014 at 4:07 am
hoseam (7/7/2014)
I'm running the Code in Toad Oracle, so #temp doesn't work there.
Are you working with SQL Server or Oracle? This is the SQL Server 2008 forum section. Answers provided...
July 7, 2014 at 3:02 am
kishore1a1216 (7/6/2014)
I am Facing this Problem ..
SELECT IDENTITY(int, 1, 1) AS 'RowID',* ,ROW_NUMBER() OVER(PARTITION BY UID ORDER BY...
July 7, 2014 at 2:59 am
Viewing 15 posts - 3,166 through 3,180 (of 10,144 total)