Viewing 15 posts - 811 through 825 (of 2,171 total)
Between has only 3 "e".
Correct spelling and try again.
July 20, 2008 at 1:59 pm
Remove Order_ID from the SELECT-list in the derived table.
July 18, 2008 at 2:25 am
Already asked and answered here
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=106744
I wonder if people like this think it is fun to make twice as many people work for them for free?
July 17, 2008 at 12:55 pm
SELECTOrder_ID,
[Pending],
[Submitted],
[Received],
[Processing-CheckedIn],
[Processing],
[Processed],
[Archived],
[Discard]
FROM(
SELECTStatusDate,
Order_Status_Cd
FROMdbo.DW_ORDER_STATUS_HISTORY
) ps
Pivot(
Max(StatusDate)
for Order_Status_Cd in ([Pending],[Submitted],[Received],[Processing-CheckedIn],[Processing],[Processed],[Archived],[Discard])
) As PivotTable
order by 1
July 17, 2008 at 12:53 pm
I recently blogged about that.
Have a look at http://weblogs.sqlteam.com/peterl/archive/2008/07/15/PIVOT-conundrum.aspx
Change you derive table ps to contain only the records present in the pivot. all other columns are used for transformation as...
July 17, 2008 at 12:52 pm
NULL are automatically dumped with UNPIVOT.
SELECTu.Name,
AVG(u.theAmount) AS Average
FROM@T AS s
UNPIVOT(
theAmount
FOR theCol IN ([Amount1], [Amount2], [Amount3])
) AS u
WHEREu.theAmount > 0
GROUP BYu.Name
ORDER BYu.Name
July 16, 2008 at 8:04 am
Maybe it's just a starting condition?
"Get these records and update a flag".
Call a SP to process the previously marked records.
Now start from beginning by picking a random record for each...
July 15, 2008 at 1:15 pm
Even in SQL Server 2000, which is the this database forum?
July 15, 2008 at 8:29 am
No need for dynamic SQL. Seems like a panic attack to me.
ALTER PROCEDURE Get_CustomerDetailsByName
(
@CustomerName varchar(30)
)
AS
SET NOCOUNT ON
SELECT*
FROMCUSTOMER
WHERECUSTOMER_NAME LIKE '%' + @CustomerName + '%'
The differencies in your result is...
July 15, 2008 at 6:17 am
DECLARE@Sample TABLE (EmpNo INT, EmpName VARCHAR(20), City VARCHAR(20), xlsOrder INT)
INSERT@Sample
SELECT101, 'scott', 'hyd', 1 UNION ALL
SELECT102, 'tiger', 'jum', 2 UNION ALL
SELECT103, 'jakir', 'trhsj', 3 UNION ALL
SELECT104, 'upers', 'luknow', 2 UNION ALL
SELECT105,...
July 15, 2008 at 2:11 am
Try this for speed
SELECTRegistrationNo,
MIN(gps_datetime) AS minTime,
MAX(gps_datetime) AS maxTime
FROMgpsdata_history
WHEREgps_datetime >= '20080713'
AND gps_datetime < '20080715'
AND analog2 = 'stepii'
GROUP BYRegistrationNo
ORDER BYRegistrationNo
July 15, 2008 at 2:06 am
Most probably an input using a single quote was used.
And the programmer of the query didn't assume that possibility and hence didn't use QUOTENAME() function to remedy.
July 11, 2008 at 12:58 pm
Viewing 15 posts - 811 through 825 (of 2,171 total)