Viewing 15 posts - 16 through 30 (of 54 total)
How about avoiding UPDATE altogether, this query seemed fast enough to me:
WITH Last_Columns AS
(
SELECT object_id, MAX(column_id) AS LastCol
FROM #columns
GROUP BY object_id
)
SELECT T.Object_ID, C.LastCol
FROM #tbl AS T
JOIN Last_Columns...
July 14, 2023 at 1:56 pm
Grant is very right. When you want to apply LEFT OUTER JOIN to a subset of outer table, do not place condition in WHERE clause. Place it in ON clause.
Itzik...
September 20, 2022 at 3:15 pm
"
The primary problem is management. They tolerate mediocre performance and they set the standards.
As long as we rely on Full-Stack-Developers, SQL will go the way of the dodo. Sure, like...
September 7, 2022 at 3:43 pm
<quote>UPDATE dbo.table_name SET column = ABS(column - 1)<quote>
Nice touch! I have not seen this trick in a long time. Congrats and thank you 🙂
August 16, 2022 at 7:37 pm
ZZartin: "This is only partially true, database constraints can prevent bad data from getting into the data base. They do not however free developers from having to both know/understand those...
August 15, 2022 at 8:16 pm
This is for @skeleton567, post with a Bible quote 🙂
I am not blaming neither DBAs nor developers. It is simply true. Good database design actually frees developers from enforcing data...
August 15, 2022 at 6:19 pm
One more small thing: if we are dealing with poor database design, sometimes neither tuning nor hardware helps.
August 12, 2022 at 7:02 pm
Can the poster show us how was the problem resolved. "If a table does not have DateCreated, how would 'the system' know which of its rows to select?"
August 10, 2022 at 8:21 pm
- Add wizard for PIVOT, like one in MS Access
- Expand list of Boolean operators, add implication => and equivalence <=>. It is cumbersome and confusing writing NOT P OR...
August 8, 2022 at 8:51 pm
Thi is what you gave us, approximately:
DROP TABLE IF EXISTS #Doctors
GO
CREATE TABLE #Doctors
(
WorkDayDate date
, Pathologist nvarchar(50)
, [Today Pathologist had 6 cases] int
, [Today Pathologist had 7 cases]...
August 8, 2022 at 8:31 pm
Can you clarify the question? What does he "line before negative line" means? Is it negative Amount or negative Balance? In the example, you are actually displaying all "positive" lines...
August 8, 2022 at 5:11 pm
Please read the answer from pietlinden. Yo must provide CREATE TABLE statements and sample data, which allows to see the goal.
No table structure, no data => no help available
August 8, 2022 at 4:13 pm
Well, CREATE VIEW is nice and can beusefull, but only after CREATE TABLE datMeterReading, EligibleActivityPerformed, mapEquipmentLocation
Once we wee how tables look like, then we can comment on the views you...
August 2, 2022 at 4:38 pm
Try not to look at the problem formally, mechanically. Describe what is happening in aa few sentences then look at them. This is how:
July 29, 2022 at 7:43 pm
Hard to tell anything. How about some CREATE TABLE statement, some tets data and explanation of the proble. How can we check the view if we do not know tables?
July 29, 2022 at 6:53 pm
Viewing 15 posts - 16 through 30 (of 54 total)