04 Mar 2009 @ 5:20 PM 

What is a SQL case statement? Well, it’s much like a switch statement in a development language. It allows you to test several different cases for a field and determine what you would like to do for each one.

If you have ever visited Mysql’s documentation, you may have been as lost as I was. You will find something like this:

CASE v
WHEN 2 THEN SELECT v;
WHEN 3 THEN SELECT 0;
ELSE
BEGIN
END;
END CASE;

If you are as confused as I was, let me provide you a better, more clear example. More »

  • Share/Bookmark
Posted By: Jamie
Last Edit: 04 Mar 2009 @ 05:20 PM

EmailPermalinkComments (0)
Tags
Tags: , ,
Categories: SQL, Theory

 Last 50 Posts
 Back
Change Theme...
  • Users » 14
  • Posts/Pages » 75
  • Comments » 231
Change Theme...
  • VoidVoid « Default
  • LifeLife
  • EarthEarth
  • WindWind
  • WaterWater
  • FireFire
  • LightLight