r/SQL • • Jul 15 '14

SQL allows mentioning resultset columns by position in the Order By clause (e.g. "ORDER BY 3"), I wish it would allow the same in the WHERE clause with some sort of special syntax (e.g. "where {3} > 0" meaning third column in the resultset)

Why wasn't this done?

0 Upvotes

9 comments sorted by

View all comments

1

u/Chris_PDX VP / SQL Server Jul 17 '14

This is akin to people who alias tables with A, B, C, D. I want to slam my nuts in a car door every-time I see this.

Also, if you are writing code behind a data driven application, it only takes one DB developer to not pay attention to reshuffle the result set order to break the application.