4 ms·
Similarly, by having the AND start in each subclause instead of being at the end of the previous clause, it's easier to "--" comment out specific clauses during
by mwexler 7y ago
Similarly, by having the AND start in each subclause instead of being at the end of the previous clause, it's easier to "--" comment out specific clauses during development. Again, harder to read, but easier to work with.
- 1996 7y agoInteresting. Can you please provide an example of what you mean?
- irrational 7y agoWHERE T.first_name = "Ender" AND T.last_name = "Wiggins" versus WHERE T.first_name = "Ender" AND T.last_name = "Wiggins" you could also do WHERE 1=1 AND T.first_name = "Ender" AND T.last_name = "Wiggins"
- 1996 7y agoThanks a lot, I thought it might have been WHERE 1=1 I will now use that to easily remove filters. An extension for the SELECT based on the very insightful top comment could be SELECT NULL ,something1 ,something2
- 121789 7y agofor whatever reason I actually find the leading "and/or" to be more readable than the trailing and/or, as long as there are more than two. The leading commas look too noisy to me, though
- robert_tweed 7y agoPersonally I find that one easier to read and tend to write e.g.: WHERE foo AND bar Or with long, complex ones: WHERE foo AND bar