« first day (4548 days earlier)      last day (618 days later) » 

04:32
Too bad no one got it right the first time
 
6 hours later…
10:23
Morning
Wordle 729 4/6*

🟩⬛⬛⬛⬛
🟩⬛⬛⬛⬛
🟩⬛⬛⬛⬛
🟩🟩🟩🟩🟩
Why does all cursor code look like
FETCH NEXT ...
WHILE @@FETCH_STATUS = 0
BEGIN
....
FETCH NEXT ...
END
and not like this:
WHILE 1=1
BEGIN
FETCH NEXT ...
IF @@FETCH_STATUS <> 0 BREAK;
....
END
Seems much more DRY to me.
11:29
I usually write mine with one FETCH
11:46
-3
Q: I am trying to delete only duplicate rows but my query is deleting all the records

Nitish KumarHere is schema of table:- INSERT INTO cars(id,model,brand,color,make) VALUES (1, 'Model S', 'Tesla', 'Blue', 2018), (2, 'EQS', 'Mercedes-Benz', 'Black', 2022), (3, 'iX', 'BMW', 'Red', 2022), (4, 'Ioniq 5', 'Hyundai', 'White', 2021), (5, 'Model S', 'Tesla', 'Silver', 2018), (6, 'Ioniq 5', 'Hyundai...

MySQL being hElPfUl as usual. Who designs these things so badly?
Cursor code is like xquery. People found one example that worked and it has been copied and pasted for millennia since.
I wish there was some simpler syntax for it, something like LOOP FOR SELECT ... BEGIN do some stuff END; dbfiddle.uk/XEG1Quvz
I guess that goes with wishing there was a dynamic_sql data type where you could actually build a proper dynamic query without risking compilation errors.
SQL really does need to up its game and move into the new millenium...
 
2 hours later…
13:56
Wordle 729 4/6*

⬛🟨⬛⬛⬛
🟨⬛⬛⬛🟩
🟩⬛⬛🟩🟩
🟩🟩🟩🟩🟩
 
4 hours later…
17:47
HFD to anyone celebrating
 
2 hours later…
19:52
Someone is Czeching me out.
20:45
Wordle 729 3/6

⬛🟨⬛⬛⬛
⬛⬛⬛⬛🟩
🟩🟩🟩🟩🟩
Tough one
 
3 hours later…
23:23
@PaulWhite-OnStrike Your Trigram article has the following comment -- Binary collation comparison so ranges work as expected what does that mean exactly? Surely any collation has a specific sort algorithm and should be deterministic over that sort? Any case you don't seem to be doing any range seeks?
@Charlieface Without looking, I imagine it was a LIKE range e.g. 0-9 or something
@PaulWhite-OnStrike Yes WHERE T.trigram COLLATE Latin1_General_BIN2 NOT LIKE '%[^A-Z0-9a-z]%' but why would that make a difference? Are there any collations where A-Z0-9a-z are not sequential? And is there a perf loss by the collation conversion, or if anything is it faster to use a binary collation?
Yes there are some Q & A on main about it
People expect 0-9 not to include superscripts and subscripts or fractions
Something along those lines
Ah I see. To be fair, I would actually expect a trigram index to include any characters which aren't punctuation or whitespace.
@PaulWhite-OnStrike What's main? Link?
23:33
OK thanks will see if I can dig some up.
[main]
That was fun to do on mobile
Re the perf difference, do you have anything on that? On the one hand, you would think a binary collation is faster to sort. On the other SQL Server is weird like that when it comes to conversions.
In this particular case indexing is not relevant, purely the existing value vs converting it.
Binary is the fastest to sort and compare. SQL collations are a little slower, full Unicode comparisons very slow
Yeah but does the conversion itself have an impact? Or is that just a compile-time thing?
Very little. It's like changing a tagged property. You're not changing the encoding
Anyway. It was literally so I could use a range rather than typing every character individually, that's all
idk if it would be faster or slower to expand manually
23:43
Sounds logical, what I suspected. Cheers.
23
A: Why are non-digits LIKE [0-9]?

Martin Smith[0-9] is not some type of regular expression defined to just match digits. Any range in a LIKE pattern matches characters between the start and end character according to collation sort order. SELECT CodePoint, Symbol, RANK() OVER (ORDER BY Symbol COLLATE Latin1_General_CI_AS) AS...


« first day (4548 days earlier)      last day (618 days later) »