Post #204,248
4/21/05 9:52:49 AM
4/21/05 9:59:22 AM
|
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
Edited by SpiceWare
April 21, 2005, 09:56:20 AM EDT
Edited by SpiceWare
April 21, 2005, 09:57:50 AM EDT
Edited by SpiceWare
April 21, 2005, 09:59:22 AM EDT
|
Post #204,378
4/21/05 8:37:47 PM
|
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)
|
Post #204,396
4/22/05 9:29:35 AM
|
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
|
Post #204,399
4/22/05 9:54:09 AM
|
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
|
Post #204,416
4/22/05 11:16:56 AM
|
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)
|
Post #204,423
4/22/05 11:35:10 AM
|
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
|
Post #204,435
4/22/05 12:14:55 PM
|
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
|