sql alias asp





SQL Alias

















Home
SQL Basics:

SQL HOME
SQL Introduction
SQL Select
SQL Where
SQL And & Or
SQL Between
SQL Distinct
SQL Order By
SQL Try It
SQL Insert
SQL Update
SQL Delete
SQL Count

SQL Advanced:

SQL Functions
SQL Group By
SQL Aliases
SQL Join
SQL Create
SQL Alter

SQL Quiz Test

Resources:

SQL Books












SQL Aliases




With SQL, aliases can be used for column names and table names.


Column Name Alias

The syntax is:


SELECT column AS column_alias FROM table




Table Name Alias

The syntax is:


SELECT column FROM table AS table_alias



Example: Using a Column Alias
This table (Persons):


LastName
FirstName
Address
City


Hansen
Ola
Timoteivn 10
Sandnes


Svendson
Tove
Borgvn 23
Sandnes


Pettersen
Kari
Storgt 20
Stavanger


And this SQL:



SELECT LastName AS Family, FirstName AS Name
FROM Persons



Returns this result:


Family
Name


Hansen
Ola


Svendson
Tove


Pettersen
Kari




Example: Using a Table Alias
This table (Persons):


LastName
FirstName
Address
City


Hansen
Ola
Timoteivn 10
Sandnes


Svendson
Tove
Borgvn 23
Sandnes


Pettersen
Kari
Storgt 20
Stavanger


And this SQL:



SELECT LastName, FirstName
FROM Persons AS Employees



Returns this result:


LastName
FirstName


Hansen
Ola


Svendson
Tove


Pettersen
Kari







Jump to : Top Of Page or HOME.


We Help you for free. Please Help us!

Help us correct errors
Help us with spelling and grammar
Tell us what you think
Link to us from your pages



All information in this Web is for training only. We do not make any warranties of its correctness or
its fitness to be used. The risk of using it remains with the user.
Copyright © 1999-2001 by Refsnes Data. All Rights Reserved.










More Tutorials:


HTML  XHTML
XML  XSL
CSS  DTD
WAP  WML
JavaScript
DHTML  Flash
VBScript  ASP
SQL  AppML






News:

The Future ofProgramming

Web Security

Browser News

Web Standards






References:

HTML 4.01 Ref

XHTML 1.0 Ref

WML 1.1 Ref

CSS Reference

XSLT Elements

ASCII Reference

Entity Reference

HTML Colors

Color Values

Color Names

WAP Pages






Validation:


HTML  XHTML
CSS  DTD
XML  WML







About W3Scripts

Please link to us








Larger Text?








 XML Partners:


















Wyszukiwarka

Podobne podstrony:
sql functions asp
sql groupby asp
sql alter asp
sql orderby asp
sql create asp
sql where asp
sql quiz asp
sql count asp
sql select asp
sql distinct asp
sql insert asp
sql join asp
sql update asp
sql intro asp
sql tryit asp
sql?lete asp
sql and or asp
sql framework aug94

więcej podobnych podstron