select case
when forum = 'yak corral' then 'no one answers'
when forum = 'script library' then 'everyone yells at me'
when forum = 'new to sql server progarmming' then 'I get my answer'
else 'who knows'
end
from MyTable
There is a CASE expression in SQL; there is no CASE statement. Rows are not records. Please post real DDL. Learn to use ISO-11179 rules for the data element names, avoid needless dialect and use ISO-8601 temporal formats, codes and so forth. People cannot read your mind, so post your code and clear specs if you really want help.
--CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing Analytics and OLAP in SQL Data and Databases: Concepts in Practice Data, Measurements and Standards in SQL SQL for Smarties SQL Programming Style SQL Puzzles and Answers Thinking in Sets Trees and Hierarchies in SQL
Joe: can you please edit your previous post and and set the part that is in your forum-signature in italics? I get REALLY sick of this rows/records/real ddl-crap all the time and I suspect that it's actually a part of your signature. And all this book-spam as well...I would think it's actually working against its purpose with all the shi* you're giving people.
My signature is my book list. When noobs quit making the same errors in SQL and netiquette over and over, why shouldn't I post the stock replies?
--CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing Analytics and OLAP in SQL Data and Databases: Concepts in Practice Data, Measurements and Standards in SQL SQL for Smarties SQL Programming Style SQL Puzzles and Answers Thinking in Sets Trees and Hierarchies in SQL
My signature is my book list. When noobs quit making the same errors in SQL and netiquette over and over, why shouldn't I post the stock replies?
Because the whole concept of a discussion forum like this is for people to ask questions they don't know the answer to, and for people that actually knoe the answer to tell it to them. Is a 15 year old boy a noob if he asks you where the carborator of a car sits?? He might be a potential world class race car driver but people like you that give him shit for trying to learn isn't really helping him along. You suck Joe, go retire or something.