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 Re: Reply from Drew
select max(o.ordernum) ordernum,\n       max(o.orderdate) orderdate,\n       decode(max(e.status),NULL,' ','X') open_excalations\n  from tbl_order o,\n       tbl_escalation e\n where e.ordernum(+) = o.ordernum\n       e.status(+) = 'open'\n group by o.ordernum, o.orderdate\n order by open_excalations desc
I've tested this in Oracle.

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
Expand Edited by SpiceWare April 21, 2005, 09:56:20 AM EDT
Expand Edited by SpiceWare April 21, 2005, 09:57:50 AM EDT
Expand Edited by SpiceWare April 21, 2005, 09:59:22 AM EDT
New DECODE is Oracle-specific.
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 It is, but it is easy to clone
I cloned it in postgres on a porting project awhile back.

However, it is not only Oracle specific, but in most cases it is EVIL since people abuse it to get out of creating reference tables.



"Whenever you find you are on the side of the majority, it is time to pause and reflect"   --Mark Twain

"The significant problems we face cannot be solved at the same level of thinking we were at when we created them."   --Albert Einstein

"This is still a dangerous world. It's a world of madmen and uncertainty and potential mental losses."   --George W. Bush
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)

Sex.
61 ms