Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 subquery in view

Author  Topic 

sent_sara
Constraint Violating Yak Guru

377 Posts

Posted - 2006-12-02 : 02:58:10
ihave create two view vpm,vcm and finally iam inserting in vfinal.while iam creating final view(vfinal),the error show is:
"The Query Designer does not support the CREATE VIEW SQL construct."
whether view cannot be created by using subquery???????

create view vfinal as
SELECT idno, token, name, wages AS prwages, designation, unit
FROM hrdbck.dbo.vpm
WHERE (idno IN
(SELECT hrd.dbo.vcm.idno
FROM hrd.dbo.vcm))

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2006-12-02 : 03:32:48
Are you doing this in SQL Server or Access? You can definitely create view with subquery in SQL Server.

Harsh Athalye
India.
"Nothing is Impossible"
Go to Top of Page

sent_sara
Constraint Violating Yak Guru

377 Posts

Posted - 2006-12-02 : 03:55:46
OK !! now its work fine another thing is,how to select the fields of suquery to display..suppose i want to print vcm wages using select..how can i?????
quote:
Originally posted by harsh_athalye

Are you doing this in SQL Server or Access? You can definitely create view with subquery in SQL Server.

Harsh Athalye
India.
"Nothing is Impossible"

Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-12-02 : 04:53:24
use INNER JOIN


SELECT idno, token, name, wages AS prwages, designation, unit, b.wages
FROM hrdbck.dbo.vpm a inner join hrd.dbo.vcm.idno b
on a.idno = b.idno




KH

Go to Top of Page
   

- Advertisement -