« first day (3241 days earlier)      last day (1618 days later) » 

6:51 AM
morning
 
Morning
 
7:24 AM
Morning
 
Morning
 
8:18 AM
buenos dias
 
9:08 AM
ƃuᴉuɹoɯ
 
@PeterVandivier I would expect Paul to say that but not you
 
9:53 AM
i've been working in NoSQL lately, my whole world is upside down ¯\_(ツ)_/¯
 
Moo
 
 
1 hour later…
11:11 AM
@PeterVandivier Could be worse. Could be working on old legacy AS/400 systems.
 
11:28 AM
I might be a little salty. The system updates a premium figure in-situ, but has another table with a list of adjustments. Fortunately it has an initial premium entry in the amendments table - except when it doesn't. I <3 crusty old legacy systems.
The legacy ETL tries to interpret a stream of consciousness from the amendments and then takes the updated value. There are 11 sprocs in the ETL and 6 consumers in the ETL that populated the DDS.
My poor little brain hurts.
 
 
1 hour later…
12:37 PM
https://pastebin.com/raw/XSsyUb0f
- english language writeup of the cayman national bank & trust hack
technical bits start at section 4
 
 
1 hour later…
1:46 PM
@PeterVandivier That's fascinating.
 
 
4 hours later…
5:56 PM
Anyone?
 
One any
 
I'm having a problem with a SQL-Server instance. Collation Latin1_General_BIN.
SELECT F1,F2,F2 FROM TABLE WHERE code IN (SELECT code FROM TABLE2 WHERE <something>)
returns all rows
Is it due to the collation?
 
Does TABLE2 actually have a code column?
 
yes, and SELECT code FROM TABLE2 WHERE <something> returns about 20 codes
 
and to confirm SELECT F1,F2,F3 FROM TABLE WHERE code NOT IN (SELECT code FROM TABLE2 WHERE <something>) yields nothing?
 
6:00 PM
it returns all rows from TABLE
 
Or more appropriately, SELECT DISTINCT code FROM TABLE has at least one value that isn't generated in the sub select?
 
The NOT IN option returns all rows as well?
 
@AndriyM nothing returned
SQL-Server 2014
SP3-CU4
 
And you're certain there is at least one code in table that isn't in the list of 20?
 
All right, but just to be on the safe side, can you also try it like this: SELECT F1,F2,F2 FROM TABLE WHERE code IN (SELECT TABLE2.code FROM TABLE2 WHERE <something>)? To make sure the subquery really takes the column from TABLE2
And what Bill said
 
6:05 PM
We're both tilting at the same conclusion. Team high five
 
@billinkc Strictly you'd need AND code IS NOT NULL in the subquery (aliased ideally)
 
Pipe down you'll get none of my chicken
 
SELECT code FROM dbo.table INTERSECT SELECT code FROM dbo.table2;
SELECT code FROM dbo.table EXCEPT SELECT code FROM dbo.table2;
 
@AndriyM bang, I've added an alias and now works fine
 
Always use aliases
3
 
6:06 PM
@PaulWhitesaysGoFundMonica 👍
 
SQL Prompt has been invaluable for this rule (alias everything) alone
 
@PaulWhitesaysGoFundMonica Yes, Monica might agree with that too
 
@billinkc Agreed
This issue comes up a lot e.g.
Apr 20 '13 at 12:21, by Paul White
Right. I prefer to use different aliases and to qualify every reference. Avoids these sorts of easy-to-make mistakes, and makes reading the thing easier IMHO.
Feb 26 '13 at 13:21, by Paul White
@MarkStorey-Smith Neither do I. Aliases ought to be required.
Schema prefixes as well
 
 
1 hour later…
7:32 PM
@PaulWhitesaysGoFundMonica ... unless you really need to not use them ;)
 
@ypercubeᵀᴹ is there such a case?
there might be, but I can't think of it
 
Yeah, one of my best answers (in my opinion at least):
https://dba.stackexchange.com/questions/44871/how-to-select-specific-rows-if-a-column-exists-or-all-rows-if-a-column-doesnt
 
oh yeah
bountied that one and still didn't remember it
 
@PaulWhitesaysGoFundMonica what would make you remember an answer?...if it had a lot of unrelated comments that weren't deleted?
 

« first day (3241 days earlier)      last day (1618 days later) »