Viewing 15 posts - 451 through 465 (of 1,491 total)
SELECT C.Colo_ID, C.Colo_Procdate, X.Res_Date, X.Res_value
FROM #Colo C
CROSS APPLY
(
SELECT TOP(1) R.Res_Date, R.Res_value
FROM #Res R
WHERE R.Res_id = C.Colo_ID
AND R.Res_Date <= C.Colo_Procdate
ORDER BY R.Res_date DESC
) X;
September 19, 2020 at 6:06 pm
You question does not make sense.
If you would care to post a sensible question (with consumable test data!!!!!) someone might give you a sensible answer.
-- *** Consumable...
September 19, 2020 at 11:07 am
If you have not already read it, you may find the following to be useful:
https://www.red-gate.com/library/troubleshooting-sql-server-a-guide-for-accidental-dbas
September 15, 2020 at 9:13 am
An example of a nested join is:
FROM TableA A
LEFT JOIN
(
TableB B
JOIN TableC C
ON B.Bid = C.Bid
)
ON A.Aid = B.Aid;
which could be written like:
FROM TableA...
September 14, 2020 at 7:09 pm
Brackets are generally used to make nested joins more recognizable even thought it is actually the order of the ONs that matter.
As this is not a nested join, the brackets...
September 14, 2020 at 7:47 am
If anyone else is affected by this, it still occurs with SQL2017 CU22 on a test VM.
September 11, 2020 at 6:29 pm
This post does not make much sense so I presume your query actually has a WHERE clause.
If the linked server has a different collation etc then the four part naming...
September 9, 2020 at 8:56 am
Also:
1. what is the point of x7? It is not referenced.
2. if the code is part of a stored procedure all those variables in the WHERE clause could produce parameter...
September 8, 2020 at 2:00 pm
ps I think this is some sort of packing or loading algorithm but the details are not clear.
September 1, 2020 at 9:18 am
The logic seems to be that, for each Noseqtrt, the rank for an address with an even count has to start with an odd number.
This sort of logic is best...
August 31, 2020 at 7:42 pm
Also, this document is worth looking at:
https://docs.microsoft.com/en-us/previous-versions/dn673537(v=msdn.10)?redirectedfrom=MSDN
August 26, 2020 at 11:40 am
I have seen similar messages caused by intermittent network errors.
You could try speaking to your systems people but these sorts of errors can be difficult to tie down. It is...
August 24, 2020 at 9:58 am
You need to pivot the 'phone numbers.
Also it looks as though some of your outer joins should be nested.
Search for both of these.
If you want tested code you need to...
August 22, 2020 at 4:57 pm
https://docs.microsoft.com/en-us/previous-versions/dn673537(v=msdn.10)?redirectedfrom=MSDN
August 14, 2020 at 2:19 pm
The tally table works, as long as the use of the numbers is consistent, and scans the table once.
UNION ALL scans the table four times.
August 7, 2020 at 1:13 pm
Viewing 15 posts - 451 through 465 (of 1,491 total)