• Welcome, Guest. Please login.
 
August 14, 2020, 08:06:25 pm

News:

Welcome to the SQLitening support forums!


Need a little help...

Started by Gary Stout, August 16, 2011, 01:56:10 pm

Previous topic - Next topic

Gary Stout

August 16, 2011, 01:56:10 pm Last Edit: August 16, 2011, 01:58:23 pm by Gary Stout
Can someone tell me what the AS CustomerNilsen refers to in the Select statement? I copied this from a tutorial site, but there was no mention of AS. Is CustomerNilsen a temporary recordset or variable that holds the number of records counted?
I need to determine how many records are being returned in a recordset.


SELECT COUNT(Customer) AS CustomerNilsen FROM Orders
WHERE Customer='Nilsen'


Thanks,
Gary
Gary Stout
gary@sce4u.com

Marc Giao

Hi Gary,

It's an alias, from:
http://www.w3schools.com/sql/sql_alias.asp

QuoteSQL Alias

You can give a table or a column another name by using an alias. This can be a good thing to do if you have very long or complex table names or column names.

An alias name could be anything, but usually it is short.



Marc


Gary Stout

Thanks Marc!

After studying a little more, I finally figured it out.  ??? I really like that www.w3schools.com website. I have been able to learn alot from studying their examples.

Enjoying SQLitening the more I learn  ;D It amazes me how much certain pieces of code can be simplified by using SQLitening. What took many lines of code in other databases and index managers can be done with literally a few lines of code.

Gary
Gary Stout
gary@sce4u.com