Make your own free website on Tripod.com

CREACION DE VISTAS

Sintaxis:

CREATE VIEW<nombre de vista>(campos)

AS
<Instrucción de Consulta>

GO

Create View v_ordenes(Orden,Empresa,Empleado,Fecha_Orden) As
select o.orderid as Orden,c.companyname as Empresa,e.lastname+','+e.firstname as Empleado,o.orderdate as [Fecha de Orden]
From (orders o inner join customers c on o.customerid=c.customerid) inner join employees e on o.employeeid=e.employeeid
Go

*Ordenando por Empresa

Select * from v_ordenes Order By Empresa,Empleado

Para Ejecutar

Select * from v_ordenes

Regresar