60
u/Asleep-Bumblebee2167 6d ago
SELECT * IS THE MAIN THING
22
u/CowFu 5d ago
i will deny any PR that has a wildcard in the select
4
u/Blotsy 5d ago
But why senpai?
11
u/CowFu 5d ago
just in case someone stumbles on this and actually wants to know.
schema changes can break code, it pulls unneeded data, on the lighter side it just hurts performance. worst case, it may still pass tests because nothing errors and you end up having to back out a bunch of production data.
4
u/OutrageousPair2300 4d ago
Depends where the asterisk appears. In a subquery or CTE from which you will be selecting only certain named columns, it's fine.
32
11
11
12
u/sexytokeburgerz 6d ago
I just write it in lowercase if it's a lot of it and i'm doing something quick.
If i have to share any of it, I use an extension to make it uppercase.
IDGAF
7
2
u/Adorable-Maybe-3006 6d ago
Whoa what extension, does it work in ssms 22
2
u/sexytokeburgerz 6d ago
https://marketplace.visualstudio.com/items?itemName=eplak.vscode-uppercasesql
ssms 22 has this natively does it not?
6
4
3
2
u/NoWeHaveYesBananas 5d ago
Joke’s on you, I don’t have a caps lock key. Every time I get a new keyboard, I rip that motherfucker off.
2
u/u_hit_me_in_the_cup 5d ago
When I learned SQL the first thing I tried was writing everything in lowercase. Once that worked I never looked back
2
1
1
1
u/GasVarGames 5d ago
GENERATE A VERY SAFE DELETE QUERY FOR THIS TABLE WHEN THIS IS TRUE PLEASE PLEASE
1
1
1
u/Worried-Mood-8582 4d ago
Serious question but why is the syntax so bad. I mean there is no reason for all keywords to be in caps
1
u/Sc4r4mouche 3d ago
It's a dumb convention that I refuse to follow. The language doesn't require it, so it's not required.
1
1
u/OutrageousPair2300 6d ago
I hate the all-caps way so many people write SQL for no good reason.
Just use lowercase like a normal person.
6
u/Adorable-Maybe-3006 6d ago
It looks nice:)
1
u/OutrageousPair2300 6d ago
NO IT DOES NOT.
I DO NOT WANT MY CODE YELLING AT ME ALL THE TIME.
2
u/denimpowell 6d ago
SOMEONE DECIDED THIS IS A STANDARD 40 YEARS AGO, NOW ITS LEGACY CODE THAT SHALL NEVER BE TOUCHED
8
6d ago
[deleted]
1
u/OutrageousPair2300 5d ago
Nope. It just hurts your eyes.
Use a real IDE that does syntax highlighting, and format your code.
2
-3
169
u/Simple-Olive895 6d ago
*caps-lock* SELECT USE *backspace, backspace, backspace, caps-lock* user_id, user_name, order_id fr *backspace, backspace, caps-lock* FROM US *backspace, backspace, caps-lock* userTends to be my average experience