If I ruled the world
2014-03-11 16:35:08.356193+00 by Dan Lyke 5 comments
If I ruled the world: I'd change the syntax of SQL to require the "WHERE" clause at the beginning of the UPDATE & DELETE statements.
2014-03-11 16:35:08.356193+00 by Dan Lyke 5 comments
If I ruled the world: I'd change the syntax of SQL to require the "WHERE" clause at the beginning of the UPDATE & DELETE statements.
[ related topics: Interactive Drama Databases ]
comments in ascending chronological order (reverse):
#Comment Re: made: 2014-03-15 00:24:12.960158+00 by: concept14
For SELECT statements as well. The FROM should come first and then the WHERE.
#Comment Re: made: 2014-03-15 13:21:20.816332+00 by: meuon
select * from foo where clue = 'confused'
is how it is in most of the SQL I use. I've seem some of the abstraction layers mess around with things, but a reason I don't like them is it removes me from the SQL system itself. Although there I times I used one more for some database independence.
#Comment Re: made: 2014-03-15 13:23:18.330932+00 by: meuon
What real drives me nuts is:
select * from foo where clue IS null
is required and syntactically different from
select * from foo where clue = null
#Comment Re: made: 2014-03-15 14:22:03.300801+00 by: Dan Lyke
That actually makes sense to me, because it is handy to have a value that is not equal to anything, even itself. And that's what differentiates null from zero or false.
#Comment Re: made: 2014-03-15 16:47:43.751701+00 by: TC
yup null not equal to false
it's like "tea party" is not equal to "republican", sure most people think they are the same but they are really different types of zeros</snark>
but seriously you can get into all kinds of hell treating an un-entered value the same as a deliberate false.