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.
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
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
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.
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