on-internet
← Community

Create View based on condition in SQL Server

Stack Overflow ·

This question is asked several times, but I cann't figure out some things. First, I have situation that I need to create view (must be view), but according to the result of one query. create view as if (select count(oid)...)>1 select1 else select2 I know that this form is not allowed. But how can I accomplish something like this? I have tens of views like this I need to create. Because these SELECT statements contain spatial conditions, and the database is big and has many many tables, I need the 'most optimal' solution, or it will query forever. I read something about using stored procedures

Comments

Sign in or sign up to comment and upvote.

No comments yet.