Viewing 15 posts - 91 through 105 (of 276 total)
Can I ask why you prefer EXCEPT over NOT EXISTS?
July 17, 2017 at 5:40 pm
A stored procedure can have more than one statement in it. If you want to break it down into two simple actions, you can.-- Update existing rows:
July 17, 2017 at 3:51 pm
I like Jacob Wilkins's solution. And I'd go a step...
July 17, 2017 at 3:41 pm
Humbled.
July 6, 2017 at 7:58 am
Well refer to my last post and see if you can sort out the ORDER BY on your own. I'm sure you can. 🙂
July 5, 2017 at 4:20 pm
Maybe you need to cast the whole "date + time" as a proper DateTime and sort by that?
WITH CTE AS
(
SELECT
...
July 5, 2017 at 4:16 pm
I'm really not sure how you want it sorted, would you like to explain it to us?
July 5, 2017 at 4:10 pm
If you need help ordering the results, try the ORDER BY statement.
To accomplish the other part, you will probably need to use a CASE statement in the second...
July 5, 2017 at 3:47 pm
This? SELECT
CAST(WorkDate AS VARCHAR(25)) + ' ' + CAST(Starttime AS VARCHAR(25)) AS WorkDateTime,
EmpID,
EmployeeName,
Code...
July 5, 2017 at 3:31 pm
Perfect case for the sexy COALESCE function:
SELECT
COALESCE([CYsales].[cust_id], [LYsales].[cust_id]) AS [cust_ID]
, [CYsales].[sales]
, [LYsales].[sales]
FROM [CYsales]
FULL OUTER JOIN [LYsales] ON...
July 3, 2017 at 3:17 pm
Gotcha, thanks Luis and Jeff as usual for sharing!
June 26, 2017 at 5:50 pm
Luis-
I understand what a Cross Join is, and I understand what your solution is doing, but I'm a bit unclear on what you mean by "unintended cross joins". Can...
June 26, 2017 at 9:49 am
I'd say that, if you ALWAYS want to cascade an update/delete, then enable it. If there will regularly be exceptions, as it sounds is the case in your situation, then...
May 23, 2017 at 9:45 am
Viewing 15 posts - 91 through 105 (of 276 total)