Hello list,
When using 'decode' is it possible to combine 2 different search
values into 1
e.g
decode(a.country, 'CH', di.identity,'JA', di.identity, de.identity)
it would be nice to say something like
decode(a.country, 'CH or JA', di.identity, de.identity)
I'm not suggesting that that is the correct syntax, but is it
possible, like it would be in a 'case' statement to give the result
for 2 values, an either or, rather than having to explicitly give the
result for each value. i can't find any examples of this.
This is Oracle 8.1.3, by the way, I know there's something else you
can use instead of DECODE, in Oracle 9.
Many thanks in advance
David 1 7855
Originally posted by David Stephenson Hello list,
When using 'decode' is it possible to combine 2 different search values into 1
e.g
decode(a.country, 'CH', di.identity,'JA', di.identity, de.identity)
it would be nice to say something like
decode(a.country, 'CH or JA', di.identity, de.identity)
I'm not suggesting that that is the correct syntax, but is it possible, like it would be in a 'case' statement to give the result for 2 values, an either or, rather than having to explicitly give the result for each value. i can't find any examples of this.
This is Oracle 8.1.3, by the way, I know there's something else you can use instead of DECODE, in Oracle 9.
Many thanks in advance
David
No, with DECODE you have to do it that way.
The "something else" is CASE:
CASE WHEN a.country IN ('CH','JA') THEN di.identity ELSE de.identity END
This works in 8.1.7, but I don't know about 8.1.3.
--
Posted via http://dbforums.com This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: epascual |
last post by:
I need to combine fields values: FirstName and Last Name to Full Name in
the same table. I like to put the value on the full name after completing
entry for the full name. Thanks for the help.
...
|
by: blyxx86 |
last post by:
I am trying to filter multiple entries with only one search box. That way the user can type whatever they want and find all the values that contain what they enter.
Private Sub...
|
by: cfwillia |
last post by:
I'm trying to make a field in my report (pulling from a query) that will list all of the text in several fields separated by commas.
I have a text box where the control source is:
= & ", " & &...
|
by: alive84 |
last post by:
Hi there
I have wrote a little script, that is used to search specific values that the User tips in.
Private Sub cmdSearch_Click()
Dim LSQL As String
Dim LSearchString As String
|
by: pcross29 |
last post by:
I've got a table that has 3 fields: CarModel, CarColor and
CarRegistration. I want to summarize the number of records by CarModel
and CarColor. Easy with a sum query:
Group By fields CarColor...
|
by: hutch75 |
last post by:
Question could also be asked, how to compare data between two arrays and perform an action (print cmd) everytime there is a match?
The problem I'm having with the code below is that the comparison...
|
by: David Stephenson |
last post by:
Hello list,
When using 'decode' is it possible to combine 2 different search
values into 1
e.g
decode(a.country, 'CH', di.identity,'JA', di.identity, de.identity)
it would be nice to say...
|
by: nomvula |
last post by:
i have a form with a dropdown values when a user select and click the search button i need to display information on another form based on the selection i've created an onclick in my search button...
|
by: VBnewb13 |
last post by:
I have a text box that I would like to type values in separated by a "," and be able to pull all matching values from the table it is searching.
Here is what I have so far:
...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
| |