How to get a column by applying logical AND operator on two column ?
All column are VARCHAR2 data type.
I have table output in this way :
col1 col2
True True
True False
False FalseBut i want a additional column in this way :
col1 col2 result
True True True
True False False
False False FalseAs the output indicates its clear that resut column is logical AND operator
on col1 and col2. How to achieve this ?
try this
WITH logic AS
(SELECT 'TRUE' col1, 'TRUE' col2
FROM DUAL
UNION ALL
SELECT 'TRUE' col1, 'FALSE' col2
FROM DUAL
UNION ALL
SELECT 'FALSE' col1, 'TRUE' col2
FROM DUAL
UNION ALL
SELECT 'FALSE' col1, 'FALSE' col2
FROM DUAL)
SELECT col1, col2,
CASE
WHEN 'FALSE' IN (col1, col2)
THEN 'FALSE'
ELSE 'TRUE'
END AS log_and,
CASE
WHEN 'TRUE' IN (col1, col2)
THEN 'TRUE'
WHEN 'FALSE' IN (col1, col2)
THEN 'FALSE'
END AS log_or
FROM logic
Explain complete.
PLAN_TABLE_OUTPUT
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)|
| 0 | SELECT STATEMENT | | 4 | 32 | 8 (0)|
| 1 | VIEW | | 4 | 32 | 8 (0)|
| 2 | UNION-ALL | | | | |
| 3 | FAST DUAL | | 1 | | 2 (0)|
| 4 | FAST DUAL | | 1 | | 2 (0)|
| 5 | FAST DUAL | | 1 | | 2 (0)|
| 6 | FAST DUAL | | 1 | | 2 (0)|
Note
- 'PLAN_TABLE' is old version
16 rows selected.regards,
friend
Similar Messages
-
How to get summary columns in delimited text file
How to get summary columns in delimited text file
I am trying to generate a delimited text file output with delimited_hdr = no.The report is a Group above report with summary columns at the bottom.In the text file the headers are not getting repeated & thats ok.The problem is the summary data is getting repeated for each row of data.Is there a way where i will get all the data & summary data will get displayed only once.I have to import the delimited text file in excel spreadsheet.Sorry there were a typos :
When I used desformat=DELIMITEDDATA with desttype=FILE, I get error "unknown printer driver DELIMITEDDATA". When you look for help, DELIMITED is not even listed as one of the values for DESTFORMAT. But if you scroll down and look for DELIMITER it says , this works only in conjuction with DESTFORMAT=DELIMITED !!!!!!??!! This is in 9i.
Has this thing worked for anybody ? Can anyone please tell if they were able to suppress the sumary columns or the parent columns of a master-detail data for that matter ? -
How to get the column index inside a dataTable
Hello,
before I get staked, there are multiple threads handling familiar topics to the one I'm questioning about but none gives an anwer. If there is one, I'm propably to less skilled to see it.
So here is my Problem: I've build a web-interface to a time-recording system. The hours worked on a certain project are displayed in a dataTable component which is generated out of a mySQL Query. Each entry (column/row) contains a inputText component to display and edit the specific value.
Editing one of these inputText elements now fires a valueChangeEvent which reads the new value and stores it in the database. For that cause I need to know the row- and column-index of the inputText component that fired the event.
Using the getClientId method from the valueChangeEvent I get some Information which makes it possible to calculate the row/column index. A typical clientID looks like "form_table:mainTable:0:_id14". "form_table" is the ID of the form the dataTable is in. "mainTable" is the id of the dataTable component. "0" is the row the component is in. And finally "_id14" stands for the id randomly given to the inputText component by JSF.
My Problem is now, that though I can calculate the column out of the[i] "_id14", this calculation is hardcoded. So everytime I add a component in before the dataTable, the calculation needs to be adjusted in the code.
The Questions:
- How to force a sensefull id indicating a column-index for the inputText components inside the columns of a dataTable?
- Nicer since no workaround: How to get the column-index inside the dataTable on a natural way? (e.g. out of the valueChangeEvent the specific inputText component fires)
After some investigation here on the board and on the net I know multiple ways to get the row index, (Things like component-binding and so on) but I can't find a answer on how to get the column-index.
Thanks to all answers and/or links to things my eyes missed while searching for one....then index 0 becomes index 1 and my program doesn't work properlyThe program works properly, just not as you expect it to.
As you've noticed the table gives you the flexibility to move columns around. So if you move column 0 to column 1, why would you expect to still use 0 as the index? The table manages the reordering of columns for you to make sure the data being displayed in each table column comes from the correct column in the data model.
You can manage this yourself using one of the following methods (I forget which one):
table.convertColumnIndexToModel(int viewColumnIndex)
table.convertColumnIndexToView(int modelColumnIndex)
Or, you can get data from the data model directly:
table.getModel().getValueAt(row, 0); -
How to get the selection parameters from logical database into one of the t
Hi Sap ABAP Champians,
How to get the selection parameters from logical database into one of the tab in the tabstrip selection-screen.
Please help me for this
Thanks
BasuHi
Thanks, that will work, but then I'll have to insert code into all my reports.
I can see that "Application Server Control Console" is able to rerun a report.
This must mean that the Report Server has access to the runtime parameters.
But how?
Cheers
Nils Peter -
How to get the column names of the table into the Dashboard prompt
how to get the column names of the table into the Dashboard prompt
Thanks & Regards
Kishore PHey john,
My requirement is as follows
I have created a Rank for Total sales by Region wise i.e RANK(SUM(Dollars By Region)) in a pivot table.
My pivot table looks like this
COLUMN SELECTOR: TOTAL US , REGION , DISTRICT , MARKET
---------------------------------------------------- JAN 2009 FEB 2009 MAR 2009
RANK REGION DOLLARS DOLLARS DOLLARS DOLLARS
1 CENTRAL 10 20 30 40
2 SOUTHERN 10 30 30 70
3 EASTERN 20 20 20 60
4 WESTERN 10 20 30 40
When i select the District in column selector
Report has to display rank based on Total Sales by District. i.e
------------------------------------------------- JAN 2009 FEB 2009 MAR 2009
RANK DISTRICT DOLLARS DOLLARS DOLLARS DOLLARS
for this i need to change the fx of rank i.e RANK(SUM(Dollars By Region)) to RANK(SUM(Dollars By District)) and fx of Region i.e Markets.Region to Markets.District dynamically.
so , i need to capture column name of the value selected from the column selector and dynamically i need to update the fx 0f RANK & fx of region.
do you have any solution for this?
http://rapidshare.com/files/402337112/Presentation1.jpg.html
Thanks & Regards
Edited by: Kishore P on Jun 24, 2010 7:24 PM
Edited by: Kishore P on Jun 24, 2010 7:28 PM -
How to get last column used in report sorting?
hi,
how to get last column used in report sorting?
simonHow to identifiy which column was sorted having different reports on page?
just use:
'YOUR_STATIC_REGION_NAME' instead of p_static_id,
:APP_ID for p_app_id,
:APP_PAGE_ID for p_page_id
:APP_USER_ID for p_app_user.
and dont forget to grant SELECT on #OWNER# to APEX_030200.WWV_FLOW_PREFERENCES$
good luck and thank you Juergen.Schuster
Simon -
How to get the column count at the bottom of the column
Hi Friends,
How to get the column count at the bottom of the column
Thanks
RajYou mean row count? Add another column, click on the fx button and type RCOUNT(1).
If you want just the total you can make it MAX(RCOUNT(1)), hide this column and then add a Narrative View after your report and enter "Total Number of Records: @n" where "n" represents what order your column is from the left side. -
hi
i am new to programming... i would like to know how to get the column values... i have a resultset object
i need code .... asap
thnx@OP: It is always good to type complete sentences and describe your problem at length. It helps in letting people know what you really need instead of making wild guesses or silly jokes. You post mentions that you get the ResultSet. Then you should look up the API docs for java.sql.ResultSet and take a look at the getxxx() method signatures. Use the ones which suit the specific case.
Besides, it is good to refrain from using asap and urgent. Even if something is urgent to you, it need not be urgent to others. Wording a question properly would attract better replies.
Finally, would you mind getting down to specifics of your problem? From what I perceived, the JDBC tutorial and the API docs should provide all the information you need. -
How to get the values of all elements and sub elements from following xml
how to get the values of all elements and sub elements from following xml...
<?xml version="1.0" encoding="UTF-8" ?>
<List_AML_Finacle xmlns="http://3i-infotech.com/Cust_AML_Finacle.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://3i-infotech.com/Cust_AML_Finacle.xsd List_AML_Finacle.xsd">
<TransactionID>TransactionID</TransactionID>
<Match>
<Src_Matched_Field>Src_Matched_Field</Src_Matched_Field>
<List_Matched_Field>
<FSFM_Matches>
<NUMBER>NUMBER</NUMBER>
<TERROR>TERROR</TERROR>
<TU>TU</TU>
<NAMEU>NAMEU</NAMEU>
<DESCRIPT>DESCRIPT</DESCRIPT>
<KODCR>KODCR</KODCR>
<KODCN>KODCN</KODCN>
<AMR>AMR</AMR>
<ADDRESS>ADDRESS</ADDRESS>
<SD>SD</SD>
<RG>RG</RG>
<ND>ND</ND>
<VD>VD</VD>
<GR>GR</GR>
<YR>YR</YR>
<MR>MR</MR>
<CB_DATE>CB_DATE</CB_DATE>
<CE_DATE>CE_DATE</CE_DATE>
<DIRECTOR>DIRECTOR</DIRECTOR>
<FOUNDER>FOUNDER</FOUNDER>
<TERRTYPE>TERRTYPE</TERRTYPE>
</FSFM_Matches>
<OfacMatchDetails>
<UID>UID</UID>
<TITLE>TITLE</TITLE>
<SDNTYPE>SDNTYPE</SDNTYPE>
<REMARKS>REMARKS</REMARKS>
<ID_UID>ID_UID</ID_UID>
<IDTYPE>IDTYPE</IDTYPE>
<IDNUMBER>IDNUMBER</IDNUMBER>
<IDCOUNTRY>IDCOUNTRY</IDCOUNTRY>
<ISSUEDATE>ISSUEDATE</ISSUEDATE>
<EXPIRATIONDATE>EXPIRATIONDATE</EXPIRATIONDATE>
<ADDRESS1>ADDRESS1</ADDRESS1>
<ADDRESS2>ADDRESS2</ADDRESS2>
<ADDRESS3>ADDRESS3</ADDRESS3>
<CITY>CITY</CITY>
<STATEORPROVINCE>STATEORPROVINCE</STATEORPROVINCE>
<POSTALCODE>POSTALCODE</POSTALCODE>
<COUNTRY>COUNTRY</COUNTRY>
</OfacMatchDetails>
</List_Matched_Field>
</Match>
</List_AML_Finacle>avoid multi post
http://forum.java.sun.com/thread.jspa?threadID=5249519 -
How to get the data of Open Opportunities and Closed Opportunities
Hi Guys,
i'm studying about Sales Opportunities in SAP BusinessOne.
i'm able to get the data about Sales Opportunities(i enterd), Opportunities Report and Lost Opportunities.
But i dont know how to get information about Open Opportunities Reports and Closed Opportunitiesn Reports.i'm unable to find even their names of tables.
plz send a reply.................
with regards,
santhThanq Alexey for ur Helpful Answer,
i'm aware about execution of a query in the Query Analyzer of SQL Server.but i dont know how to move to ShowDebugInformation Menu.
can i find it in the SAP Business One Tool. or do i need
to check any data base help given by B1(Ex:- REFDB2004).
plz give answer for this also............
with regards,
santh -
I have a new MacBook Air and don't know how to get info from my USB stick and get info from my SD card. Can anyone help, please?
Plug the stick and/or card into the appropriate slots on the side of your Air. Do you see icons for the devices appear on the desktop? Click into them to see what files are there.
Matt -
How to get classification for a given material and material type in MM
Hello Friends,
One of my developer colleagues is struggling to find out : how to get classification for a given material and material type in MM?
He is looking for probable table and table fields to Select from.
I would appreciate seriously any help in this regard.
~Yours SincerelyHi
Below given the flow and table details for a given class and class type.
- Table KLAH --> This contains the "Internal class no" [ for the given Class & Class type ]
- Table KSML --> This contains the " internal character numbers " [ nothing but characteristics attached to the class ] , which can be fetched with the above fetched internal class no
- Table AUSP --> This table contains the objects ( material ) attached to the internal characters of that class
- Table CABNT --> This table contains the "Description" for the internal character numbers.
- award points if this is ok -
I am trying to figure out how to get the total allocated CPUs, memory and storage in a particualr reservation through vRealize Automation Java SDK.
I am trying to figure out how to get the total allocated CPUs, memory and storage in a particualr reservation through vRealize Automation Java SDK.
-
Can anyone tell me how to get rid of Cookies in Safari and Firefox?
Can anyone tell me how to get rid of Cookies in Safari and Firefox?
Am using Mountain Lion MacBook Pro ThanksFirefox/Preferences/Privacy - small blue type.
-
I am just starting out in graphic design and I wanted to know how to get more involved with either adobe and or graphic design? I am really very interested in working with adobe and graphic design more and becoming more involved with both!!
I have now recently downloaded 10.0.2 which is confusing in itself, as, as far as I can ascertain that is actually version 11, but I'm not even sure about that.
Version 10.0.2 is the newest version and the successor to GarageBand '11 (version 6.0.5).
The '11 is referring to the iLife '11 suit of multimedia application - the older GarageBand was a part of this bundle.
Have a look at Edgar's graphical enhanced manuals, the explain very detailed how things work and why. You can buy them as iBooks from the iBook store or directly from the page:
http://DingDingMusic.com/Manuals/
Maybe you are looking for
-
USING FORM BUTTONS IN ADOBE ACROBAT/READER
Hello, I am using Adobe Acrobat Std XI to create a form that Adobe Readers will be filling in. Everything works in the form except for the button I inserted to allow the user to reset/clear the form. The button works fine in Acrobat but it is no wor
-
Taking a screenshot while touching the screen with iOS6
Hello, Ever since I updated my iPhone 4S to the new iOS6 I noticed I can't take screenshots while touching the screen, for example - if I want to take a screenshot of a text message while rolling up the screen (so that only a certain part of the scre
-
I got the USB camera adapter for the ipad mini but when I connect it with my Samsung camera pl120, it appears that's too much power on my ipad mini..,,,so I don't know what to do??????
-
Trouble printing LARGE format images from Photoshop CC to Acrobat XI
Hi All, I had no issues printing a 1mtrx1mtr @ 300dpi image to Acrobat, now that I am trying a 2mtrx1mtr @ 300dpi it is not doing anything. I get the initial Acrobat printer popup, tell it to print, photoshop CC says I may be printing something outsi
-
Distrubution & Assessment cycles - CO
Hi, I seem to be having problems when executing the cycles. The sender is correct but there seems to be no receiver. The error message I got was "The segment contains no receivers"-GA733. Could it be because the version that I'm using is differe