Viewing 15 posts - 1,636 through 1,650 (of 2,645 total)
Sounds like you want some logic like this:SELECT IIF(c.column1 IS NULL AND c.column2 IS NULL,d.column3,c.column1) col1,
IIF(c.column1 IS NULL AND c.column2 IS...
March 12, 2019 at 9:12 am
DBA_007 - Tuesday, March 12, 2019 6:50 AMany update on the result
One relatively straight forward way to fix the problem is to...
March 12, 2019 at 6:57 am
March 12, 2019 at 5:52 am
SELECT FirstName, SecondName, T.MaxPayDate Pay_Date
FROM Employee e
CROSS APPLY(SELECT TOP(1) Pay_Date
FROM (SELECT MAX(Pay_Date) Pay_Date
...
March 12, 2019 at 5:04 am
declare @Date datetime
select @Date =DATEADD(mm, DATEDIFF(mm, 0, GETDATE()) - 2, 0)
Exec Results @Date
You can't have expressions in the calling parameters.
March 12, 2019 at 4:42 am
March 11, 2019 at 9:12 pm
March 11, 2019 at 9:37 am
The optimizer will workout the best order to join the tables. So it will make no difference. However, there is a hint (FORCE ORDER) you can use to...
March 11, 2019 at 7:52 am
polkadot - Monday, March 11, 2019 12:19 AMworks for me. Thank you peitlinden 🙂
For SQL 2008 and above you can use
March 11, 2019 at 5:58 am
or this:;WITH SAMPLE_DATA([AccountNumber],[Charge Category]) AS
(
SELECT '00001XXA',220 UNION ALL
SELECT '00001XXA',250 UNION ALL
SELECT '00001XXA',360 UNION ALL
...
March 9, 2019 at 12:20 pm
I'd use SQL Server's built in PERCENTILE_CONT function. Just call it with the numeric_literal = 0.5 and it will return...
March 9, 2019 at 9:32 am
[code language="sql"
Incorrect syntax near...
March 8, 2019 at 2:32 pm
UPDATE a
SET a.DOC2 = b.DOC2
FROM myTable a
CROSS APPLY(SELECT TOP(1) b.DOC2 FROM myTable b WHERE b.DOC = a.DOC ORDER BY b.VERSION) b
March 8, 2019 at 10:25 am
I think this is an equivalent query;WITH cte as
(
SELECT tkt.OrderHeader,a.*,sum(value) OVER (partition by tkt.orderheader,date) as Profit
FROM dbo.[OrderDetails] ...
March 8, 2019 at 7:21 am
USE Test
GO
DECLARE @p1 AS INT = 9, @p2 AS INT = 2;
SELECT CAST(@p1 AS NUMERIC(12, 2))/ CAST(@p2 AS NUMERIC(12, 2)) ReturnResult
INTO dbo.TestDivisionReturnType;
GO
EXEC sp_help 'dbo.TestDivisionReturnType'
GO
DROP TABLE dbo.TestDivisionReturnType
March 8, 2019 at 5:55 am
Viewing 15 posts - 1,636 through 1,650 (of 2,645 total)