Forum Replies Created

Viewing 5 posts - 16 through 20 (of 20 total)

  • RE: UNION ALL is hanging the server and is very slow.

    Ninja's code has the additional benefit that it will give correct results. If there are any columns in the invoice table's PK that are not in the SELECT clause, there...

  • RE: using CASE in WHERE clause

    Hi,

    I don't think it needs to be that complicated. Does this work:

    SELECT * FROM Tbl1

    WHERE TYPE = CASE @TYPE WHEN 1 THEN 1

    WHEN 2 THEN 2

    ELSE TYPE END

    Regards,

    Mike

  • RE: Getting Colorful

    An old one: “Spaghetti code” - when you’re reading it, it’s hard to follow the flow of control. The nemesis of structured programming, caused by GOTO.

    Cargo cult programming -...

  • RE: Views

    The question is misleadingly worded. A view definition can contain a CTE, but the CTE is not "part of" the SELECT statement. The CTE can contain its own SELECT statement,...

  • RE: Can't resolve err in delete from syntax

    Or this:

    delete

    from

    table1

    where

    exists

    (

    select id

    from table2 as dest

    where dest.id = table1.id

    )

    Just lose the "AS."

Viewing 5 posts - 16 through 20 (of 20 total)