Viewing 15 posts - 1,261 through 1,275 (of 59,072 total)
Here is an alternative that a) does not use an OR and b) does not use a subquery.
WITH TempOrdered AS
(
SELECT t.ID
...
--Jeff Moden
Change is inevitable... Change for the better is not.
July 27, 2023 at 3:00 pm
Hi Ddee,
You can achieve the desired result using the following SQL query:
sql
SELECT ID, flag, name FROM your_table t WHERE (flag = 0 AND NOT EXISTS (SELECT 1 FROM your_table...
--Jeff Moden
Change is inevitable... Change for the better is not.
July 27, 2023 at 2:53 pm
Heh... I saw no indication of your comment being hypothetical. I'm concerned that others won't, either. 😉
--Jeff Moden
Change is inevitable... Change for the better is not.
July 27, 2023 at 6:32 am
My personal feeling is that phone numbers for people that have taken a survey are actually no one's business and should not be included in a DW.
--Jeff Moden
Change is inevitable... Change for the better is not.
July 26, 2023 at 5:41 pm
Hi, Ellen. Welcome aboard.
It'll be interesting to see how the ORs in that affect performance on larger tables. I'll try to setup a larger test tonight.
--Jeff Moden
Change is inevitable... Change for the better is not.
July 26, 2023 at 5:24 pm
Preamble:
I know Jonathan posted test code and solution code but his code returns the word "Header" for the "Edge Case" of the "LineType" (my name for the "field") not being...
--Jeff Moden
Change is inevitable... Change for the better is not.
July 26, 2023 at 2:39 am
We are in the process of rolling out SQL Server 2022 to production. Hopefully getting the first environment done after the Summer. The dealbreaker for us was Azure AD...
--Jeff Moden
Change is inevitable... Change for the better is not.
July 25, 2023 at 5:25 pm
Ah... my apologies, James. Based on your request (repeated below), I interpreted it as there would be 1 to 4 "numbers" in a single row. What you meant was "one...
--Jeff Moden
Change is inevitable... Change for the better is not.
July 25, 2023 at 3:41 pm
Thanks to ChatGPT for creating the temp table
DROP TABLE if exists #TempTable;
go
CREATE TABLE #TempTable
(
ID INT,
flag int,
...
--Jeff Moden
Change is inevitable... Change for the better is not.
July 25, 2023 at 4:40 am
Thanks to ChatGPT for creating the temp table
Let's see what the actual prompt for that was, please.
For those interested, here's a link to the prompt that I used and...
--Jeff Moden
Change is inevitable... Change for the better is not.
July 25, 2023 at 4:05 am
You can get it via this SQL code:
SELECT t.ID, t.flag, t.name
FROM your_table_name t
WHERE
(t.flag = 0 AND NOT EXISTS (
...
--Jeff Moden
Change is inevitable... Change for the better is not.
July 25, 2023 at 4:04 am
How can i adjust the substring to grab from 1 to 4 numbers in the UISeq?
SELECT UIMth = substring(t.yourcolumn, 8, 8) , UISeq = substring(t.yourcolumn, 24, charindex(' ', t.yourcolumn,...
--Jeff Moden
Change is inevitable... Change for the better is not.
July 25, 2023 at 3:57 am
Nothing, anywhere, is perfectly secure. There are always vulnerabilities. We just don't always know what they are until it's far too late.
However, I still land where I always land...
--Jeff Moden
Change is inevitable... Change for the better is not.
July 24, 2023 at 1:53 pm
There are also hidden dangers to "Autonomy" and that is the danger of being "forgotten" or "pigeon-holed" or coming across as a bit arrogant. For example, if you answer the...
--Jeff Moden
Change is inevitable... Change for the better is not.
July 24, 2023 at 3:30 am
This is a beautifully written article and the order of revelation is spot on. Of course, I cannot be sure but it looks like something that AI would write (and,...
--Jeff Moden
Change is inevitable... Change for the better is not.
July 24, 2023 at 2:58 am
Viewing 15 posts - 1,261 through 1,275 (of 59,072 total)