What are some cool SQL shorthands that you know of?
For example, something I learned today is you can specify to group by an index:
SELECT col1, col2 FROM table GROUP BY 2
This will group by col2
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
See Aaron Bertrand’s “Bad Habits in SQL to kick” series – he has a post on this and highly recommends not using that notation: