Viewing 15 posts - 2,776 through 2,790 (of 10,144 total)
An alternative to Luis' method:
SELECT
e.*,
x.Addresscode, x.AddressType, x.[Address]
FROM #employee e
OUTER APPLY (
SELECT TOP 1 *
FROM #EmpAddress a
WHERE a.Eid = e.Eid
ORDER BY AddressType, Addresscode
) x
November 26, 2014 at 4:21 am
IMHO the option "Neither" is correct, because MERGE is likely to outperform options 1 and 2, both of which require a test in some or all cases. Since the poster...
November 26, 2014 at 2:20 am
Eirikur Eiriksson (11/26/2014)
😎
SELECT
CASE
...
November 26, 2014 at 1:38 am
Evil Kraig F (11/24/2014)
Jeff Moden (11/24/2014)
Eirikur Eiriksson (11/24/2014)
November 25, 2014 at 6:45 am
sgmunson (11/21/2014)
November 21, 2014 at 7:37 am
Thanks Serg, my bad:
SELECT a.id
,T1.F.value('(//Node1)[1]', 'varchar(100)') x
--,T2.F.value('(//Node2)[1]', 'varchar(100)') y
FROM #Table1 AS a
CROSS APPLY a.data.nodes('//Node1') AS T1(F) -- part 1
LEFT JOIN #Table1 b
CROSS APPLY a.data.nodes('//Node2') AS T2(F) -- part 2
ON...
November 21, 2014 at 7:02 am
The restrictions of the FLOAT datatype are specified here. The numbers you've posted look ok, however I'd recommend you check your data for elements which may be out of range.
November 21, 2014 at 6:00 am
If you look again at the original query:
...
FROM
Table1 AS a
CROSS APPLY data.nodes('.../Node1') AS T1(F) -- part 1
LEFT JOIN Table1 AS b
CROSS APPLY data.nodes('.../Node2') AS T2(F)...
November 21, 2014 at 4:35 am
manifbest (11/20/2014)
I want to find out the standard deviation from the following value but it gives me error because i am using STDEV function from the MSSQL.
My...
November 20, 2014 at 5:56 am
sgmunson (11/19/2014)
ChrisM@Work (11/19/2014)
Steve - (F) is a column name assignment:
SELECT * FROM (SELECT 1) d (ColumnName)
Ahhh, ... ok... I try really hard NOT to use that kind of...
November 19, 2014 at 7:14 am
Steve - (F) is a column name assignment:
SELECT * FROM (SELECT 1) d (ColumnName)
November 19, 2014 at 6:43 am
Ashish Dutt (11/18/2014)
...Is there any other way of accomplishing this task in lesser amount of query execution time?Please suggest. Eagerly awaiting your conducive response.
Yes there is. You mentioned that two...
November 19, 2014 at 2:10 am
Stored procedures marked to run on startup:
SELECT [name] FROM master.dbo.sysobjects WHERE type = 'P' AND OBJECTPROPERTY(id, 'ExecIsStartUp') = 1;
November 18, 2014 at 8:28 am
That's horrible code. A cursor loop is much the same as a while loop, you won't gain anything by changing your existing loop into a different one. What you really...
November 18, 2014 at 6:22 am
Complex queries run the risk of failing to obtain a satisfactory execution plan, as the optimiser doesn't have sufficient time to explore all possibilities. You'll get a plan so the...
November 14, 2014 at 7:25 am
Viewing 15 posts - 2,776 through 2,790 (of 10,144 total)