Viewing 5 posts - 16 through 20 (of 20 total)
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...
April 11, 2011 at 2:56 pm
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
July 19, 2010 at 8:15 am
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 -...
May 7, 2010 at 10:43 am
Or this:
delete
from
table1
where
exists
(
select id
from table2 as dest
where dest.id = table1.id
)
Just lose the "AS."
February 1, 2010 at 7:47 am
Viewing 5 posts - 16 through 20 (of 20 total)