| ASP Programming | ASP Web Pro |
|
ASP TutorialsSQL ADVANCEDOK, so you got through our SQL Basics Tutorial. Now, we are moving on to some more advanced SQL statements. As a refresher, here is our standard connection and recordset information, which shows you where your SQL will go.
Now, let's get to the good stuff. Here are some of the more advanced things you can do with your SQL statements.
This example counts the number of records contained in our intInvoices table.
This example sums a currency field called revenue from our intInvoices table. There are other commands you can use other than SUM in the same way. You can also replace SUM with AVG, MIN, or MAX to find the average, minimum, or maximum values. If you are really into statistical analysis, you can even use VARIANCE or STDDEV to return the variance or standard deviation values.
This example selects all of the records in our tblInvoices tables where the DueDate field equals todays date.
This example selects all of the records in our tblInvoices tables where the Type field is equal to a string or text variable such as "Customer" that is entered on your ASP page.
This example selects all of the records in our tblInvoices tables where the Number field is equal to an integer or numeric variable such as "100" that is entered on your ASP page. These are only some of the more advanced SQL statements. We are still only scratching the surface here, but we will continue to add more advanced SQL statements to this page as time goes on so be sure to check back.
|
||||||||
|
Main Menu Other Resources
Last Updated:
|
||||||||
|
© 1997-2008 ASP Web Pro, Inc. | Terms of Use
|