hi all..
i dont understand this sql statement(decode and least)
please help me..
sum(decode(f.code_category,'3', nvl(decode(d.flag_result,null,decode(least(b.date, :p_startingdate+1)b.date,1),0),1),0))
please convert this to if and else statement...so that i can understand...thank you..
3 2988
As you have posted a qustion it articles section it is moved to Oralce forum.
MODERATOR.
hi all..
i dont understand this sql statement(decode and least)
please help me..
sum(decode(f.code_category,'3', nvl(decode(d.flag_result,null,decode(least(b.date, :p_startingdate+1)b.date,1),0),1),0))
please convert this to if and else statement...so that i can understand...thank you..
decode returns a particular value is the condition is satisfied or the 2nd value if the second cond is satisfied ,if no condition satisfies the it returns null,it else statment is not specified.
least ---returns the least value in the list , in your case the least date out of two daes.
I can convert it to IF ...ELSE
but the problem is it is not possible to execute IF ....ELSE directly in sql statments.
if u stilll have doubts please dopost back.
CHECK THIS IF ..ELSE FORMATE
SUM(
IF f.code_category=3
THEN
IF d.flag_result= null
THEN
IF b.date <= p_startlngdate+1 THEN
RETURN(b_date)
END IF;
ELSE-- NOT NULL THEN
RETURN 1;
END IF;
ELSE
RETURN (0)
END IF
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Newbie |
last post by:
How would I modify this form
to encode *all* the characters
in the 'source' textarea to the
'%xx' format & place result
code into the 'output' textarea?
(cross browser compatable)
Any help is...
|
by: Amin Schoeib |
last post by:
Hi,
Like I see there is no equivalent to the Oracle decode Function
In Postgres.Is there maybe somebody who wrote decode as a
Function?
Schoeib
4Tek Gesellschaft für angewandte...
|
by: Guoqi Zheng |
last post by:
Dear sir,
I need to decode base64 encoded email.
I used below function but it does not work correctly, especially when I need
to decode some Characters like Chinese,
Can some one point out...
|
by: MP |
last post by:
I have the following command.
SELECT A.STORE_NAME, A.STORE_NUM, A.ZIP_CODE, B.EMPLOYEE_ID, B.GENDER,
B.EMP_LEVEL, C.ITEM_CODE,
DECODE(B.ITEM_CODE,1, 'CHICK_BURGERS') ITEM_DESCR,...
|
by: rsd |
last post by:
Hi,
I'm trying get Samsung YH-920 mp3 player to work with Debian GNU/Linux.
To do that I need to run
http://www.paul.sladen.org/toys/samsung-yh-925/yh-925-db-0.1.py
script, the idea behind the...
|
by: Medhatithi |
last post by:
Hi,
I am facing a strange problem with decode function in oracle. My table name is status_hist. Below is the query I am hitting on this table:
select...
|
by: blurryhaddad |
last post by:
hi all..
i dont understand this sql statement(decode and least)
please help me..
sum(decode(f.code_category,'3', nvl(decode(d.flag_result,null,decode(least(b.date,...
|
by: d-fan |
last post by:
void decodebio( unsigned char *encbuf, unsigned char * decbuf, int
destbuf ) {
/* Read Base64 encoded data from standard input and write the
decoded data to standard output: */
BIO...
|
by: ollyb303 |
last post by:
Hello,
I have been using the following expression in Access as part of a statement to query an Oracle database:
(Sum(CASE WHEN STATS_DAILY_SA.LOGIN_TIME > (STATS_DAILY_SA.SCHEDULED_TIME -...
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
| |