IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New Are you sure? I checked MySQL before posting
I put decode in the search box at [link|http://www.mysql.com/|MySQL.com]. The first result was [link|http://dev.mysql.com/doc/maxdb/en/cf/63316bc03511d2a97100a0c9449261/content.htm|DECODE(x,y(i),...,z)] with sample code
SELECT hno, price, DECODE (type,\n'single', 1, 'double', 2, 'suite', 3) room_code\n  FROM room\n    WHERE hno IN (40,50,60)
As such, I figured it supported decode and posted my example for Drew.
Darrell Spice, Jr.                      [link|http://spiceware.org/gallery/ArtisticOverpass|Artistic Overpass]\n[link|http://www.spiceware.org/|SpiceWare] - We don't do Windows, it's too much of a chore
New They may have added it but it is not standard
If they did add it, I don't know which version it would have been.

I know that when I went searching for it, I was pointed at a conversion from Oracle's DECODE to MySQL's CASE. (Which doesn't seem like it quite matches the SQL-92's standard for CASE either. Oh well.)

Cheers,
Ben
I have come to believe that idealism without discipline is a quick road to disaster, while discipline without idealism is pointless. -- Aaron Ward (my brother)
New Seems to be specific to MaxDB
MaxDB is the databsse MySQL got when they partnered with SAP. It does have an Oracle like decode. MySQL has a function called decode, but it an encryption function that works opposite encode.

Jay
New That's rather confusing
odd that the MaxDB version of Decode would come up first on a MySQL site search. Oh well.
Darrell Spice, Jr.                      [link|http://spiceware.org/gallery/ArtisticOverpass|Artistic Overpass]\n[link|http://www.spiceware.org/|SpiceWare] - We don't do Windows, it's too much of a chore
     How to do without subqueries - (drewk) - (18)
         SELECT DISTINCT t1.* FROM t1, t2 ...? - (FuManChu)
         I don't understand your description - (ben_tilly) - (16)
             Reply from Drew - (Meerkat) - (15)
                 Re: Reply from Drew - (SpiceWare) - (6)
                     DECODE is Oracle-specific. -NT - (ben_tilly) - (5)
                         It is, but it is easy to clone - (tuberculosis)
                         Are you sure? I checked MySQL before posting - (SpiceWare) - (3)
                             They may have added it but it is not standard - (ben_tilly)
                             Seems to be specific to MaxDB - (JayMehaffey) - (1)
                                 That's rather confusing - (SpiceWare)
                 One solution - (JayMehaffey) - (1)
                     FWIW this was the best I saw for our needs - (drewk)
                 Untested, googling for supported syntax - (ben_tilly)
                 Re: Reply from Drew - (dws) - (4)
                     You're ordering by the wrong thing - (ben_tilly) - (3)
                         Where do you see me ordering by count(*) ? -NT - (dws) - (2)
                             You weren't, clarification - (ben_tilly) - (1)
                                 Re: You weren't, clarification - (dws)

You can’t fight math. I’ve tried. I lost.
227 ms