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
 General SQL Server Forums
 New to SQL Server Programming
 view error msg 156, level 15

Author  Topic 

maqza
Starting Member

7 Posts

Posted - 2011-02-23 : 04:11:34
HI!
In view showing msg " inorrect syntax neat the keyword'or'
msg 156, level15, state1, line 1

CREATE OR REPLACE VIEW prices_view

AS

SELECT PRCDTE, MKTPRC, MKTCDE, SYMCDE,

(SELECT MAX(VLNDTE) FROM vlnasshis

WHERE SYMCDE = a.SYMCDE AND MKTCDE = a.MKTCDE

AND vlndte < a.prcdte) VLNDTE,

(SELECT ownbal

FROM vlnasshis

WHERE SYMCDE = a.SYMCDE AND MKTCDE = a.MKTCDE

AND vlndte =

(SELECT MAX(VLNDTE) FROM vlnasshis

WHERE SYMCDE = a.SYMCDE AND MKTCDE = a.MKTCDE

AND vlndte < a.prcdte)

) OWNBAL

FROM symhis a

thanks in advance



webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2011-02-23 : 04:24:10
You can use CREATE VIEW or you can use ALTER VIEW.
But there is nothing like CREATE OR REPLACE VIEW.


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page
   

- Advertisement -