View Full Version : General SQL script question
HisLeast
May 5th 2009, 03:43 AM
Ok... so I'm learning how to build views in SQL, and I just saved myself a crazillion hours by learning about aliases for tables. Is there anything similar for columns? Like if I'm puling "assigned_to_workgroup" from the "task" table... is there any way I can get the view to show it as "group"?
I'll try to post the raw SQL tomorrow from work.
bdh
May 5th 2009, 06:19 AM
What are you using? M$QL? MySQL? Do you have a GUI administrator tool?
Guilo
May 5th 2009, 06:34 AM
here is a MySQL example of how to do that:
SELECT e.errlogid as "id" FROM errorlogs e
here is the MSSQL example of doing that:
SELECT e.errlogid as [id] FROM errorlogs e
the column in the source table is errlogid however the result dataset will return the column as id.
the same syntax can be used in both the select statement when creating your view as well as when selecting from your view
HisLeast
May 5th 2009, 12:56 PM
BDH,
I'm using MySQL and the interface I'm using is the MySQL Administrator.
Guilo,
Thanks, I'll give that a shot this morning! :)
|
|
Hosted By Webnet77vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd. |