MS SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesMS SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 11th, 2004, 10:22 AM
kcushing kcushing is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Location: Utah
Posts: 6 kcushing User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 8 m 55 sec
Reputation Power: 0
Query runs but won't save as View

The following query will run just fine:

SELECT name, COUNT(name) AS unindexes, MIN(
case
when var6 <> '' then 7
when var5 <> '' then 6
when var4 <> '' then 5
when var3 <> '' then 4
when var2 <> '' then 3
when var1 <> '' then 2
else 1 end) AS nfields
FROM syitabs
WHERE dupef = 0
GROUP BY name

But when I try to save it as a view, I get the error:

"View definition includes no output columns or includes no items in the FROM clause."

But I do have output columns, and the table 'syitabs' in the from clause is correct. Like I say, I can run the query and get back results!

I know I have saved a view before with a case statement, so I don't think that is it. Anyone have any ideas?

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMS SQL Development > Query runs but won't save as View


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway