SQL
-
Why, after all these years, is there still no standard for basic features of SQL. For example, the syntax for returning only [n] rows. Top vs Limit[^] This sort of stuff drives me nuts, as it requires a call out to the specific DB interface to properly generate the SQL for specific DB provider. Argh. And if you want to do something more complex, like offsets and limits, this[^] is a fun read illustrating the syntax differences. Marc
Imperative to Functional Programming Succinctly Higher Order Programming
As said, vendor lock in. It was the same thing (sorta still is a bit) with the web for years. Everyone wants you to think "their way" is the best way.
Jeremy Falcon
-
Why, after all these years, is there still no standard for basic features of SQL. For example, the syntax for returning only [n] rows. Top vs Limit[^] This sort of stuff drives me nuts, as it requires a call out to the specific DB interface to properly generate the SQL for specific DB provider. Argh. And if you want to do something more complex, like offsets and limits, this[^] is a fun read illustrating the syntax differences. Marc
Imperative to Functional Programming Succinctly Higher Order Programming
LIMIT
does make paging super easy. I know it's easier to do in SQL Server these days, but withLIMIT
it's as easy as this:SELECT * FROM mytable LIMIT 50, 50;
Assuming you're showing 50 records per page and currently viewing the second page.
Jeremy Falcon
-
As said, vendor lock in. It was the same thing (sorta still is a bit) with the web for years. Everyone wants you to think "their way" is the best way.
Jeremy Falcon
Jeremy Falcon wrote:
Everyone wants you to think "their way" is the best way.
When we all know, my way is the only way.
Michael Martin Australia "I controlled my laughter and simple said "No,I am very busy,so I can't write any code for you". The moment they heard this all the smiling face turned into a sad looking face and one of them farted. So I had to leave the place as soon as possible." - Mr.Prakash One Fine Saturday. 24/04/2004
-
Why, after all these years, is there still no standard for basic features of SQL. For example, the syntax for returning only [n] rows. Top vs Limit[^] This sort of stuff drives me nuts, as it requires a call out to the specific DB interface to properly generate the SQL for specific DB provider. Argh. And if you want to do something more complex, like offsets and limits, this[^] is a fun read illustrating the syntax differences. Marc
Imperative to Functional Programming Succinctly Higher Order Programming
Personally, I'd rather dump SQL completely, and go for a binary interface that doesn't let idiots leave themselves wide open to SQL Injection - but that's just crazy talk!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
-
Personally, I'd rather dump SQL completely, and go for a binary interface that doesn't let idiots leave themselves wide open to SQL Injection - but that's just crazy talk!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
OriginalGriff wrote:
but that's just crazy talk
You're thinking way too progressive man. Might one wanna take time to cherish the old archaic way. This way we don't have to learn new concepts.
Jeremy Falcon
-
Personally, I'd rather dump SQL completely, and go for a binary interface that doesn't let idiots leave themselves wide open to SQL Injection - but that's just crazy talk!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
writing code that writes code which gets interpreted at runtime in a black box is the modern way.
-
Why, after all these years, is there still no standard for basic features of SQL. For example, the syntax for returning only [n] rows. Top vs Limit[^] This sort of stuff drives me nuts, as it requires a call out to the specific DB interface to properly generate the SQL for specific DB provider. Argh. And if you want to do something more complex, like offsets and limits, this[^] is a fun read illustrating the syntax differences. Marc
Imperative to Functional Programming Succinctly Higher Order Programming
It's standardized since ISO SQL:2008 as the "FETCH FIRST" clause And it's starting to get support too, it's at the moment supported by atleast IBM DB2, PostgreSQL, Microsoft SQL Server 2012 and Oracle 12c.
Wrong is evil and must be defeated. - Jeff Ello Any organization is like a tree full of monkeys. The monkeys on top look down and see a tree full of smiling faces. The monkeys on the bottom look up and see nothing but assholes.
-
Personally, I'd rather dump SQL completely, and go for a binary interface that doesn't let idiots leave themselves wide open to SQL Injection - but that's just crazy talk!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
It'll never fly, Orville.
-
writing code that writes code which gets interpreted at runtime in a black box is the modern way.
I am sooooo tempted to have that as a sig! :laugh: :thumbsup:
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
-
It's standardized since ISO SQL:2008 as the "FETCH FIRST" clause And it's starting to get support too, it's at the moment supported by atleast IBM DB2, PostgreSQL, Microsoft SQL Server 2012 and Oracle 12c.
Wrong is evil and must be defeated. - Jeff Ello Any organization is like a tree full of monkeys. The monkeys on top look down and see a tree full of smiling faces. The monkeys on the bottom look up and see nothing but assholes.
Jörgen Andersson wrote:
"FETCH FIRST"
Isn't that only for cursors? Got a link to documentation?
-
Why, after all these years, is there still no standard for basic features of SQL. For example, the syntax for returning only [n] rows. Top vs Limit[^] This sort of stuff drives me nuts, as it requires a call out to the specific DB interface to properly generate the SQL for specific DB provider. Argh. And if you want to do something more complex, like offsets and limits, this[^] is a fun read illustrating the syntax differences. Marc
Imperative to Functional Programming Succinctly Higher Order Programming
I think the usage of
TOP
should be extended to include aSKIRT
keyword to provide theOFFSET
functionality. -
Jörgen Andersson wrote:
"FETCH FIRST"
Isn't that only for cursors? Got a link to documentation?
Wrong is evil and must be defeated. - Jeff Ello Any organization is like a tree full of monkeys. The monkeys on top look down and see a tree full of smiling faces. The monkeys on the bottom look up and see nothing but assholes.
-
I think the usage of
TOP
should be extended to include aSKIRT
keyword to provide theOFFSET
functionality.And don't forget the
REMOVE
clause.Wrong is evil and must be defeated. - Jeff Ello Any organization is like a tree full of monkeys. The monkeys on top look down and see a tree full of smiling faces. The monkeys on the bottom look up and see nothing but assholes.
-
Jörgen Andersson wrote:
"FETCH FIRST"
Isn't that only for cursors? Got a link to documentation?
Naturally, MS messed up again by putting it together with the
ORDER BY
clauseWrong is evil and must be defeated. - Jeff Ello Any organization is like a tree full of monkeys. The monkeys on top look down and see a tree full of smiling faces. The monkeys on the bottom look up and see nothing but assholes.
-
Jeremy Falcon wrote:
Everyone wants you to think "their way" is the best way.
When we all know, my way is the only way.
Michael Martin Australia "I controlled my laughter and simple said "No,I am very busy,so I can't write any code for you". The moment they heard this all the smiling face turned into a sad looking face and one of them farted. So I had to leave the place as soon as possible." - Mr.Prakash One Fine Saturday. 24/04/2004
Michael Martin wrote:
When we all know, my way is the only way.
there is always, "the highway".
-
Why, after all these years, is there still no standard for basic features of SQL. For example, the syntax for returning only [n] rows. Top vs Limit[^] This sort of stuff drives me nuts, as it requires a call out to the specific DB interface to properly generate the SQL for specific DB provider. Argh. And if you want to do something more complex, like offsets and limits, this[^] is a fun read illustrating the syntax differences. Marc
Imperative to Functional Programming Succinctly Higher Order Programming
Marc Clifton wrote:
Why, after all these years, is there still no standard for basic features of SQL
There is a standard, as others will probably have pointed out. I've been using the ANSI 92 standard for personal projects; it is quite portable between different types of databases.
Marc Clifton wrote:
And if you want to do something more complex
..then I would not ask the DAL to do so.
Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]
-
Marc Clifton wrote:
Why, after all these years, is there still no standard for basic features of SQL
There is a standard, as others will probably have pointed out. I've been using the ANSI 92 standard for personal projects; it is quite portable between different types of databases.
Marc Clifton wrote:
And if you want to do something more complex
..then I would not ask the DAL to do so.
Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]
Eddy Vluggen wrote:
I would not ask the DAL to do so
Exactly, that's an application responsibility.
-
And don't forget the
REMOVE
clause.Wrong is evil and must be defeated. - Jeff Ello Any organization is like a tree full of monkeys. The monkeys on top look down and see a tree full of smiling faces. The monkeys on the bottom look up and see nothing but assholes.
That's applicable to the Basic Relational Architecture.
-
That's applicable to the Basic Relational Architecture.
As is the Lookup Table
Wrong is evil and must be defeated. - Jeff Ello Any organization is like a tree full of monkeys. The monkeys on top look down and see a tree full of smiling faces. The monkeys on the bottom look up and see nothing but assholes.
-
Wrong is evil and must be defeated. - Jeff Ello Any organization is like a tree full of monkeys. The monkeys on top look down and see a tree full of smiling faces. The monkeys on the bottom look up and see nothing but assholes.