Search Options
close
Search the following clips:
All Clips
Everyone's Clips
My Guides
Sign Up
Install
Learn More
Login
Superb DECODE function usage
yourfrienddhruv
follow
0
10-9-2007 10:04 AM
279 views
tags:
decode
,
sql
Add a Comment
Login
to Comment. Not a member yet?
Sign up
Today's Top Clips
Student Suspended for Cancer Head Shave
8 Memorable Sesame Street Celebrity Cameos
Shock Therapy on internet Addicts
University Shuts Down Anti-Communism Display
Guess which one was on Janet Napolitano's terrorist watch list
Code Pink target and taunt children of military families
Anyone else getting this error on Clipmarks?
beauty shines through
Do these pants make my butt look big?
School Photograph
visit the
Top Clips page
View the Top Clips from
October 9, 2007
Embed This Clip In Your Site...
<div style="margin: 12px 0px; font-family: arial; color: #333333; background: #ffffff; border: solid 4px #e5e5e5; width: 100%; clear: left;"><div class="CM_CTB_Content_Wrap" style="margin: 0px; padding: 0px;background-color: #ffffff;"><div style="border-bottom: solid 1px #dcdcdc; white-space: nowrap; margin-bottom: 8px; background-color: #eeeeee ;background-image: url(http://www.clipmarks.com/images/source-bg.gif); background-repeat: repeat-x; height: 24px; line-height: 24px; vertical-align: middle; padding-bottom: 4px; color: #666666; font-size: 10px;" ><a href="http://clipmarks.com/clip-to-blog/" title="see clips that are hot right now"><img src="http://content.clipmarks.com/blog_embed/28cfd3d8-1863-4227-aae0-3445646e3c04/D717AF53-CCDB-4152-80D0-ED6302E8BAEA/" alt="" width="19" height="19" border="0" style="vertical-align: middle; margin: 0px 4px; display: inline; border: none; float:none;" /></a>clipped from <a title="http://techonthenet.com/oracle/functions/decode.php" href="http://techonthenet.com/oracle/functions/decode.php" style="font-size: 11px;">techonthenet.com</a></div><blockquote style="text-align: left; padding: 0px 8px; margin: 4px 0px 8px 0px; background: transparent; border: none;" cite="http://techonthenet.com/oracle/functions/decode.php"><P><B>Question</B>: One of our viewers wanted to know how to use the decode function to compare two dates (ie: date1 and date2), where if date1 > date2, the decode function should return date2. Otherwise, the decode function should return date1.</p> <P><B>Answer</B>: To accomplish this, use the decode function as follows:</p> <BLOCKQUOTE class="sql_command"> <P>decode((date1 - date2) - abs(date1 - date2), 0, date2, date1)</p> </BLOCKQUOTE> <P>The formula below would equal 0, if date1 is greater than date2:</p> <BLOCKQUOTE> <P>(date1 - date2) - abs(date1 - date2)</P></BLOCKQUOTE></blockquote></div><div style="margin: 0px 6px 6px 4px;"><table style="font-size: 11px;border-spacing: 0px;padding: 0px;" cellpadding="0" cellspacing="0" width="100%"><tr><td style="background:transparent;border-width:0px;padding:0px;"> </td><td align="right" style="background:transparent;border-width:0px;padding:0px;width:107px" width="107"><a href="http://clipmarks.com/share/D717AF53-CCDB-4152-80D0-ED6302E8BAEA/blog/" title="blog or email this clip"><img src="http://content6.clipmarks.com/images/c2b-foot.png" border="0" alt="blog it" width="107" height="17" style="border-width:0px;padding:0px;margin:0px;" /></a></td></tr></table></div></div>
Clipmarks
Home
New Clips
Top Clips
Dashboard
Popular Topics
News
Life
Science
Technology
Entertainment
Get Started
Sign Up
Install Clipping Tool
How Clipping Works
Clip-to-Blog™
ClipSearch
Tools and Resources
FAQ
ClipWeek
Top Clippers
Top Tags
Site Map
About Clipmarks
About Us
Contact
Blog
Copyright
Privacy
EULA
OK