Adding every other field of two separate rows together.

Hi,
We're using Oracle 11.1.
I's like to add two rows from two different queries together,
I'd like it to look something like:
with
a as
( select 'a' q,'b' r,'c' s,'d' t,'e' u from dual),
b as
( select '1' q, '2' r,'3' s,'4' t,'5' u from dual)
select a.q, b.r, a.s, b.t, a.u from a, b;The trouble is I'm already using WITH and both the 'real queries' get their data from the progressive WITH statements already up top.
I'd like to add every other field from each query to a result row.
I have to use only SQL.
Is there a way I can use UNION and combine the rows using dummy fields for the fields I don't want to use?
Some something like
I know this isn't right but...it sort of what I want to do.
select * from
( select 'a' q,' ' r,'c' s,' ' t,'e' u from dual
union
select '1' q, '2' r,' ' s,'4' t,' ' u from dual);Anybody?

Can u try using join.
select a.q, b.r, a.s, b.t, a.u from
(select 'a' q,'b' r,'c' s,'d' t,'e' u from dual) as a,
( select '1' q, '2' r,'3' s,'4' t,'5' u from dual) as b;
This will result in a Cartesian join, but if you have a common column between a & b, then you can use it in the where clause.

Similar Messages

  • Opening and Closing values on two separate rows for an indvidual A/c?

    Hi / Salam To all SAP Members,
    I am creating a COGS report in which i need to show opening and closing values for a stock account in two separate rows. The tool i am using is report painter.
    What i need to know is how can the system identify between opening and closing values for that account? Which characteristic/s do i need to include in the rows? The table i am using is FAGLFLEXT.
    Please provide help.
    Regards,
    Mohammed Ali Khan.

    Resolved Issue.

  • OBIEE: Link Two Separate Queries Together

    Hi,
    I am trying to link two separate queries together in BIEE.
    I have a query that will give me the sales value in January 2012 (monthly query)
    But I would need to use the sales value of January 2012 to help derive the weekly sales value in another query (weekly query).
    How would you link up two queries together?
    I tried using union but it doesnt seem to be working.
    Thanks.
    Bill

    Hi Billy,
    Sure, My pleasure. Here are the basic steps what you could go through.
    1. Create an analysis with your Month (January) and Sales.
    2. Save this analysis as Report1.
    3. Create another analysis with Week and Sales.
    4. Create a filter on column:Sales using the option 'Based on Another Analysis'. The analysis editor will provide you an option to browse your other analysis which you want this analysis to be based on and just click on this browse button, and navigate to and select Report1.
    5. Once you have selected Report 1 through browse option, you get down in the same pop-up the relationship and use values in column.
    So sample entries in this pop-up might look like
    Column : Sales
    Operator : is based on results of another analysis
    Saved Analysis : /My Folder/Report1
    Relationship : is equal than
    Use values in Column : Sales
    6. If you run this analysis, you could get all weekly sales figures which are equal to the january sales figures.
    Hope this helps.
    Thank you,
    Dhar

  • Adding a new field to an Automatic Row Processing form

    Hi,
    I have a form that I built through the form Wizard which has an automatic row processing function. It is working very well, except that any new fields I add to the form are not being updated in the database when the row is processed. I have set up the field exactly the same as other fields which are working and were originaly created by the wizard. I have deleted and recreated the row processing Page Process, but nothing seems to make it work. Have I missed anything? I don't want to recreate my page from scratch each time I want to add a new field.
    Thanks,
    Steve

    if you're positive that your new fields/columns update correctly when you use Text Field items and not when you use Select List ones, i'd check to see what your select lists are returning. a good way to see exactly what your form got from your select list items is to check the session state for your select list items right after you submit your page (clicking the "Session" link in your developer toolbar in your runtime environment is a good way to get to this info). also, even though you said your added Text Fields work and your Select Lists don't, i'd still check the "Source Type" and "Source value or expression" fields of your select list items to make sure they're set correctly. for form items to work with your table in htmldb auto-dml processing, you need to set the "Source Type" to "Database Column" and the "Source value or expression" to the case-sensitive name of your db column.
    hope this helps,
    raj

  • How can I sum every other column in the same row?

    I have, for each employee, two columns: Planned and Worked.
    I would like to sum the values in each Planned column. There are 25 employees, each with their own Planned and Worked columns, on the same row.
    How can I do a SUM of every other column, starting with Planned?
    Thank you.

    Thank you, Yellowbox!
    The exact formula didn't work; however, it gave me a precise path to follow and come up with this: =SUMIF(E2:BB2,"=Planned",E3:BB3)
    Week
    Ending Date
    Planned Subtotal
    Worked Subtotal
    Employee1
    Employee2
    Employee3
    Planned
    Worked
    Planned
    Worked
    Planned
    Worked
    1
    01/04/2014
    120
    40
    38
    40
    44
    40
    50
    2
    01/11/2014
    If not for your starting point, I'd have wasted many more hours on this.
    Thanks again!
    BB

  • XML fields importing in separate rows in Excel

    When importing the *.xml files from a returned form into Excel 2010, the fields correctly populate into columns, but each field also gets a separate row. It seems the xml is specifying a 'new row' for each field, when it isn't required. This creates a diagonal display of information (headers along row 1, info in A2, B3, C4, D5...)
    When I import multiple *.xml, i get multiple diagonal displays, which look pretty, but aren't very functional.
    Any ideas on how to get this to display correctly?
    Thanks

    Hello, Allan:
    Thanks for the reply...I never would have divined the
    SQL statement that you provided:)
    IMHO, learning how to mix SQL with XML-related stuff
    seems to be non-trivial in many cases. Even for the
    people who who XPath/XSLT the exact SQL syntax is not
    necessarily obvious:(
    Is there a tutorial/FAQ that provides lots of examples
    that illustrate useful/interesting tips/techniques?
    I think many people would benefit from such an FAQ.
    For the truly ambitious, this could be the start of
    an interesting book (e.g., "XML and SQL in Oracle").
    Regards,
    Oswald

  • Noob: Is there a way to "group" two clips on two separate layers together?

    Hi, total FCE-newbie here, having barely got to grips with iMovie - so please bear with me...
    I'm trying to do something which I would have thought is pretty simple in FCE, but I'm flummoxed...
    I have two video clips, one above the other on two different layers, in sync with each other. I want to "group" these two clips together, so that any effects or edits I apply will affect both clips simultaneously.
    I found this video tutorial which does exactly what I want, but (a) it's for FC Pro, and (b) it's obviously for a much older version:
    http://www.rippletraining.com/movies/Free%20Downloads/040301185027.mov
    That's exactly what I want to do, but I don't seem to have those options available to me - at least not that I can find.
    I've looked up "nesting" in the FCE manual, but it talks about something totally un-related, going on about "sequences", and I only have ONE (long) sequence. I don't want to nest or group sequences, but rather I want to group two short clips / layers.
    The option-C shortcut mentioned in the video tutorial does nothing for me, and unfortunately the guy doesn't say which menu this keyboard shortcut would normally be found under...
    Or am I trying to do something that isn't actually possible in FC Express, and is only available in FC Pro?
    FCE HD 3.5

    Tom Wolsky wrote:
    http://www.rippletraining.com/freetutorials_oldies_butgoodies.html
    That is not a link to clip but to the page that has all the tutorial. Jeez.
    Oh come on... You're STILL not reading posts properly before you reply???
    I said that I linked directly to the clip in question TWICE. In my first/original post, AND in my second post. Go back and check my very first post. What do you see there? A link directly to the clip in question, perhaps? Yes, that's right.
    As for you quoting your own responses to try and prove your point... Well, you're only serving to point out that your posts were misleading and accurate. Let me show you:
    Tom Wolsky wrote:
    putting the two clips in a sequence and putting the sequence inside another one is nesting, and that's exactly what the *_FCP (Final Cut PRO)_* function does.
    (My emboldening)
    Now that's not accurate is it? Can you see why I found your original answer misleading? Because that is NOT what happens in the PRO version of Final Cut. The walkthrough shown in the clip (which I linked to directly) shows nothing about sequences within sequences - only nesting two clips together in one sequence.
    If you had not told me this inaccurate piece of information, then maybe the rest of what you said would have made more sense in context.

  • When stiching two separate scans together, I can't bucket fill (use PS6.0)

    The platen or glass
    on my scanner isn't large enough to accomodate my 11inchX14inch
    map sketch I am attaching. So I scan in as much of it as possible, then crop i
    t accordingly and keep it set as PDF. I then turn over the original and scan the sam
    e way to get a lower bottom portion of this image and crop the area I need, copy it and pas
    te it in open area BELOW other half and match all the lines for the streets u
    sing the UP & DOWN arrows on my keyboard.
    Here is where my problem begins...I color the open areas but then as I move upward, the areas with red X all cover that entire other half GREEN. Anything I need to do BEFORE I RETRY this? Please help. Keep in mind, area below RED line is section I "stiched" up to this half ot image....
    Thank you

    If you haven't already, click on contiguous in the paint bucket
    tool options bar.
    MTSTUNER

  • Need Trigger that format a field based on two other fields

    Hello!
    I need to write a trigger, that reads on field and made some changes to it and saves the result in an other field in the same row. The trigger should work in insert and update cases.
    Does anybody can send me a frame, where i can fill my logic?
    Regards
    Heiko Glaeske

    In this example, column1 and column2 are the values being examined and the resultant expression is saved in column3.
    create or replace trigger trigger_name
    before insert or update on table_name
    for each row
    begin
      :new.column3 := :new.column1 + :new.column2;
    end;
    /

  • How to get count and other field in one select

    Hi,
    I am try to get total rows and some fields in two separate select:
    1. select count(id) into totalRows from mytable m where m.cat = 'CSV'
    2. select m.id, m.cat, m.updateTime from mytable m where m.cat = 'CSV'
    (all rows in mytable are distinct base on id field)
    How can I combine them into one query to make it faster so that no need to compare the m.cat field twice?
    Thanks.
    David

    Here's one solution :
    SQL> desc test;
    Name Null? Type
    ID NUMBER
    CAT VARCHAR2(10)
    UPDATE_TIME TIMESTAMP(6)
    SQL> select * from test;
    ID CAT UPDATE_TIME
    1 XYZ 09-JAN-04 09.04.17.000000 AM
    2 CSV 09-JAN-04 09.04.31.000000 AM
    4 ABCD 09-JAN-04 09.04.41.000000 AM
    5 CSV 09-JAN-04 09.04.53.000000 AM
    6 ABC 09-JAN-04 09.05.00.000000 AM
    7 CSV 09-JAN-04 09.05.06.000000 AM
    8 GGG 09-JAN-04 09.05.17.000000 AM
    7 rows selected.
    SQL> select id, cat, update_time
    2 ,Count(*) Over (Order By cat) As TotCnt
    3 from test
    4 Where cat = 'CSV'
    5 /
    ID CAT UPDATE_TIME TOTCNT
    2 CSV 09-JAN-04 09.04.31.000000 AM 3
    5 CSV 09-JAN-04 09.04.53.000000 AM 3
    7 CSV 09-JAN-04 09.05.06.000000 AM 3
    SQL>
    -- Shailender Mehta -

  • Copy data of two rows together into a new row

    Hello everyone.
    I have a question about copying data of two existing rows together into a new third row.
    See this short example:
    This is the current situation. The rows STATE_1 and STATE_2 contain different separated information.
    In the past data were saved randomly in one of those rows.
    This is the table State:
    ID
    Cust_ID
    STATE_1
    STATE_2
    STATE_3
    1
    88
    Customer is waiting.
    Call from yesterday.
    2
    11
    Mr. Smith, no answer.
    Waiting until December
    3
    11
    Pls create PO.
    Old PO was cancelled
    4
    5
    No access to system.
    From now on everything has to be saved to the empty STATE_3 but I also need the old entries from the past which also have to be copied together into STATE_3
    like this:
    ID
    Cust_ID
    STATE_1
    STATE_2
    STATE_3
    1
    88
    Customer is waiting.
    Call from yesterday.
    Customer is waiting. Call from yesterday
    2
    11
    Mr. Smith, no answer.
    Waiting until December.
    Mr. Smith, no answer. Waiting until December.
    3
    11
    Pls create PO.
    Old PO was cancelled.
    Pls create PO. Old PO was cancelled.
    4
    5
    No access to system.
    No access to system.
    Is there an easy SQL-command?
    Thanks for any help.

    Hi,
    DB2000 wrote:
    Hello everyone.
    I have a question about copying data of two existing rows together into a new third row.
    See this short example:
    This is the current situation. The rows STATE_1 and STATE_2 contain different separated information.
    In the past data were saved randomly in one of those rows.
    This is the table State:
    ID
    Cust_ID
    STATE_1
    STATE_2
    STATE_3
    1
    88
    Customer is waiting.
    Call from yesterday.
    2
    11
    Mr. Smith, no answer.
    Waiting until December
    3
    11
    Pls create PO.
    Old PO was cancelled
    4
    5
    No access to system.
    When you say "row", do you mean "column"?
    DB2000 wrote:
    Because in this case STATE_1 and STATE_2 are only text of a log file/history.
    So I think 1NF isn't really violated and because of performance of the database in this case it's better to put obsolete rows together.
    Why do you think that?
    The definition of First Normal Form is that every column of every row contains 1 piece of information, not a variable number of pieces.  Whether or not that data is only text of a log file/history has nothing to do with it.
    You might claim you have good reasons (such as performance) for violating First Normal form, but you can't say that you're not violating it.

  • Comparing values in two consecutive rows?

    Hello.
    Can I compare the value of the same field in two consecutive rows?
    If it is. How could I do it?
    Thanks in advance

    Hi,
    You can use analytics like LAG/LEAD, but it would be helpful if you'd post an example.
    Search and read the docs for examples @ http://tahiti.oracle.com
    A search on this forum will give you some examples as well.

  • Get the sum/product of two UDF rows before adding A/R Invoice

    Hi Everyone,
    I am making some tests here where I am trying to get the sum or product of two UDF rows in a service type A/R invoice where I need to get the product before i even add the document.
    The query goes like:
    SELECT T0.[U_UDF1] * T0.[U_UDF2] FROM INV1 T0 WHERE T0.[U_UDF1] = $[INV1.U_UDF1]
    It did not work. Is this possible?
    Thanks,
    Derrick

    Before you add a transaction, the values you specify in the screen are not stored into the database. In an FS you can use SQL statements but in these statements you can refer only to the actual header or row level data with the special expressions starting with $. The system replaces these expressions with a constant containing the actual value before executing the SQL string.
    So there is no possibility to sum the columns with FS before adding the document.
    Sorry, I didnu2019t read carefully your question and probably misunderstood it.
    Edited by: István K#rös on Jan 13, 2011 11:27 AM

  • Framemaker 8. Landscape Chapters adding blank page every other page.

    Hi,
    I am currently using FrameMaker 8 to create my book. I have multiple chapters, both Landscape and Portrait. I use Framescript > Scripts > Insert Reports to insert PDF documents into my chapters. I have an excel spreadsheet that has two columns code/pdf file name that the Framscript uses to insert the report. I insert a code into the chapter, and from that code it references the matching PDF file to insert.
    I have been running this without any issues until now, because now in the Landscape chapters it is adding a blank page between all my pages. So every other page is blank. For example if the PDF file had 2 pages now I have 2 pages and 2 blank pages. On the blank page I do have a symbol (RS Report Spacer) that appears. I could delete it and the blank page goes away. But this can be troublesome since I have hundreds of pages and every time I run my book the blank pages will reappear.
    I have tried Pagination to delete blank pages but to no avail. It does not delete the blank page. The weird part is that for my Portrait chapters this problem does not occur. I am writing this with a small glimmer of hope somebody can help me.
    Thank you in advance,
    Dan

    Hello there @sirknite ,
    I read your post about your printing out blank pages from your Windows 8 system however, this issue does not occur on another PC. In the details you have mentioned, it seems to be an issue with the software on your Windows 8 system, as the other computer does not have a problem. To test this theory, try printing from another program to see if blank pages will still print out. This way, we will know if the problem is originating in one specific program, or in the printer driver.
    Skipping ahead a little bit, try running the Print and Scan Doctor. This diagnostic tool will check for any conflicts that could be causing the issue. The tool will show you a report at the end. If there was a problem that the tool could not fix, you will notice it in the results.
    Try printing again, and if any blank pages still print out, try Uninstalling the Printer Software, restarting the computer completely, and download and reinstall the printer here: HP Photosmart Full Feature Software and Drivers
    Please write me back with your findings and all of the results from your troubleshooting. Include which programs you have tested out and any other helpful information you may have came across.
    Happy New Year!
    R a i n b o w 7000I work on behalf of HP
    Click the “Kudos Thumbs Up" at the bottom of this post to say
    “Thanks” for helping!
    Click “Accept as Solution” if you feel my post solved your issue, it will help others find the solution!

  • How do I take two separate non numeric fields in a acrobat form and combine the data to display in a third separate field?

    How do I take two separate non numeric fields in a acrobat form and combine the data to display in a third separate field?

    You have to use custom JavScripting to concatenate the first 2 fields. You cannot use the first 2 calculation options because they force the values of the fields to a numeric value or ignore string values.
    Possible scripts for the 3rd field are:
    event.value = this.getField("Text1").valueAsString + " " + this.getField("Text2").valueAsString;
    or
    event.value = this.getField("Text1").valueAsString.concat( " ",  this.getField("Text2").valueAsString);
    If you do not want change the separator or not show the separator when on or the other field is empty, you will need to add more code to adjust for change.
    The above scripts will also concatenate number because the field values are read as strings and not numbers.
    There is also a generalized user written function to concatenate up to 3 fields with a separator that adjust for missing data.

Maybe you are looking for

  • How to get my macbook to connect to the Apple TV?

    How to get my macbook to connect to the Apple TV in a strange apartment? I am housesitting for someone for a few months. They mentioned that i would be able to use their Apple TV to play stuff from my macbook. I am using their basic wifi in the apt,

  • Report with dynamic order by (binding of parameter)

    hy, my problem is the following: i want to let the user customize the ordering of a portal report. but the binding does not really work, the bind variable seems to have no effect in the order by clause. code sample: select * from SCOTT.EMP order by :

  • IPod will not act as a harddrive to save files

    Hi all, I'm trying to save a file on my iPod in Windows. I've done this many, many times before, when my iPod was in windows format. I had changed it to Mac format, but for this purpose I've changed it back to Windows format. I can't understand why I

  • All media I drop to timeline needs to be rendered, what's wrong?

    So here is as much detail as I can give about my problem. I have a new Mac Book Pro. I just installed Final Cut Studio 2. I am editing mp3 sound files and .MPEG video files that I modified from .MOD files. No matter what media I drop into my timeline

  • RSS feeds in tabel celle

    I have an tabel there I in an celle will link to this RSS Path : http://www.borsen.dk/services/newsfeed/rss/ ( with danish caracters ) How can I solve this ? Can DreamWeaver handle RSS feeds ?