|
Common Table Expressions
|
|
09-30-2009, 06:29 PM
Post: #1
|
|||
|
|||
|
Common Table Expressions
Anyone who does database programming beyond the simplest of queries should probably have a mild understanding of Common Table Expressions. I've only discovered them recently and they are extremely helpful to simplify complex queries. Here is a very, very simple example:
SQL Code
Obviously you could do this with a single query very easily but this is simply to show you how the structure of it works. Edit: I did intend to link to this thread so google would have some search terms to build from. Also, CTEs aren't available in all SQL databases. SQL Server 2000 doesn't support them but SQL Server 2005 does. |
|||
|
10-06-2009, 06:40 PM
Post: #2
|
|||
|
|||
|
RE: Common Table Expressions
I really do only perform the simplest of queries in databases. I've never really thought to look into more advanced stuff too much because the basics I know always manage to handle what I need it to do.
Also, I don't know if it was intended or not, but the link in your post goes to this thread. Yilduz Network I am the Einstein of PHP. $E = $m * pow($c,2); |
|||
|
« Next Oldest | Next Newest »
|

Search
Member List
Calendar
Help


