SQL Server 2000, Create View question

  • Hi, I need your help!

    I need to create a SQL Server 2000 view with this format:

    SELECT

    case when failed = 'N' then

    (select * from aaa)

    else

    (select * from bbb)

    end

    FROM

    dimstatus

    The command succeed but when I try to execute I get this message:

    Only one expression can be specified in the select list when the subquery is not introduced with EXISTS.

    I also tried to create it with an IF statement, but I figured out that the IF is not allowed, can you please help me?

    Thanks SO much in advance,

    Joe.

  • Please do not cross-post.

    [font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
    Proactive Performance Solutions, Inc.
    [/font]
    [font="Verdana"] "Performance is our middle name."[/font]

  • Sorry, first time here.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply