Return max value from one column from similar values in another

Hi folks. I've got a heap of temperature data to analyse and am looking for an easy way to extract a maximum internal temperature from a group of readings with the same external temperature. E.g. When the external temperature is 25.0 there are say 20 different internal temperature values that correspond with the different dates and times that this external temperature occurs. I'm looking for a formula I can use in a separate table with the external temperatures in a header column that will refer to the header column and extract the data from the original table. Any help appreciated! E.g. below...
Internal (°C)
Loc 4-Ambient
Index
Date
TimeValue
Time
External (°C)
22.7
1.70
465
11/10/12
0.33
8:00:00 am
21
22.7
0.90
466
11/10/12
0.35
8:30:00 am
21.8
24.5
2.10
417
11/9/12
0.33
8:00:00 am
22.4
23.4
1.00
513
11/11/12
0.33
8:00:00 am
22.4
22.9
0.20
467
11/10/12
0.38
9:00:00 am
22.7
25.8
2.90
370
11/8/12
0.35
8:30:00 am
22.9
25.7
2.80
371
11/8/12
0.38
9:00:00 am
22.9
25.7
2.80
372
11/8/12
0.40
9:30:00 am
22.9
25.6
2.70
373
11/8/12
0.42
10:00:00 am
22.9
24.5
1.60
418
11/9/12
0.35
8:30:00 am
22.9
25.6
2.50
369
11/8/12
0.33
8:00:00 am
23.1
max temp
21.0
21.1
21.2
21.3
21.4
21.5

Hi Barry,
thanks for the response. Sorry, my example was not exactly clear. I'll take out the superfluous data and try and clarify my problem further. Based on the table below, I have sorted the data based on ascending external temperature (At these low external temperatures there are not so many data points, but when we get into the late 20s and 30s there can be hundreds of corresponding points). What I want to create is a separate table that I can graph, with the X axis showing the external temperature and the Y axis showing the maximum internal temperature that corresponds with each 0.1 degree increment of the external temperature.
external
internal
16.5
26.7
16.5
26.4
17
26.6
17.1
26.8
17.2
26.9
17.3
27.3
17.3
26.4
17.5
26.7
17.6
28.1
17.7
27.4
17.8
26.7
17.9
27.4
18
28.1
18
27.4
18.1
27
18.1
26.9
18.1
26.5
18.1
28
18.2
28.1
18.2
27.2
18.3
28.1
18.4
27.5
18.4
27.3
So my second table would just be two columns (I had 3 in the first example because I am doing a before and after painting the roof white comparison but I'm simplifying now) with my external temperature scale in column A in 0.1 degree increments. I am looking for a formula for column B that will give me the maximum internal temperature from my range of temperatures in the first table.
18.0
18.1
18.2
18.3
18.4
18.5
18.6
18.7
etcetera. The max for 18.1, for example, would turn out 28 based on the 4 corresponding data points in the first table.
Ideally I would like a formula using the MAX equation because I'm hoping that I can do a similar table for getting the average internal temperature for each of the external temperature increments too, but I didn't want to overcomplicate matters.
Cheers,
Neewok

Similar Messages

  • LOV Return To More Than One Column

    Hello,
    How could I return LOV values to more than one column?
    I created a dynamic LOV based on sql statement. I would like to return more than one values to multiple columns in my page.
    E.g. When user selects employee number name, department and location to return to respective columns.
    Any help is highly appreciated.
    I am using APEX 3.2.0.
    Thanks

    hi,
    Below link might help you.
    http://rutgerderuiter.blogspot.com/2008/10/update-multiple-items-from-lov-field.html

  • Update one table with the max value of another table

    CREATE TABLE [dbo].[General](
    [a_id] int NOT NULL,
    [a_date] datetime NOT NULL,
    [c_date] datetime NULL)
    CREATE TABLE [dbo].[Specific](
    [a_id] int NOT NULL,
    [a_date] datetime NOT NULL,
    [b_id] int NOT NULL,
    [d_date] datetime NULL)
    insert into General values (111,'Jan 1 2013', null)
    insert into General values (112,'Jan 1 2013', 'Mar 10 2014')
    insert into General values (113,'Jan 1 2013', null)
    insert into General values (114,'Feb 1 2013', null)
    insert into General values (115,'Feb 1 2013', 'Apr 1 2013')
    insert into General values (116,'Feb 1 2013', 'Jan 1 1970')
    insert into Specific values (111,'Jan 1 2013',1, 'Jan 1 2013')
    insert into Specific values (111,'Jan 1 2013',2, 'Feb 1 2013')
    insert into Specific values (111,'Jan 1 2013',3, 'Mar 1 2013')
    insert into Specific values (112,'Jan 1 2013',1, 'Jan 1 2013')
    insert into Specific values (112,'Jan 1 2013',2, 'Feb 1 2013')
    insert into Specific values (113,'Jan 1 2013',1, 'Jan 1 1970')
    insert into Specific values (114,'Feb 1 2013',1, null)
    insert into Specific values (115,'Feb 1 2013',1, 'Jan 15 2013')
    insert into Specific values (115,'Feb 1 2013',2, 'Feb 15 2013')
    insert into Specific values (116,'Feb 1 2013',1, 'Jan 30 2013')
    insert into Specific values (116,'Feb 1 2013',2, 'Jan 1 1970')
    I want to update General.c_date only when the values are null or Jan 1 1970 from the maximum value of Specific.d_date as long as the maximum is not null or Jan 1 1970.    The two tables join on a_id and a_date.  In the example  above 
    a_id = 111 and a_date = Jan 1 2013 should have c_date = Mar 1 2013 and a_id = 116 and a_date = Feb 1 2013 should have c_date = Jan 30 2013.
    lg

    Try the below:
    CREATE TABLE [dbo].[General](
    [a_id] int NOT NULL,
    [a_date] datetime NOT NULL,
    [c_date] datetime NULL)
    CREATE TABLE [dbo].[Specific](
    [a_id] int NOT NULL,
    [a_date] datetime NOT NULL,
    [b_id] int NOT NULL,
    [d_date] datetime NULL)
    insert into General values (111,'Jan 1 2013', null)
    insert into General values (112,'Jan 1 2013', 'Mar 10 2014')
    insert into General values (113,'Jan 1 2013', null)
    insert into General values (114,'Feb 1 2013', null)
    insert into General values (115,'Feb 1 2013', 'Apr 1 2013')
    insert into General values (116,'Feb 1 2013', 'Jan 1 1970')
    insert into Specific values (111,'Jan 1 2013',1, 'Jan 1 2013')
    insert into Specific values (111,'Jan 1 2013',2, 'Feb 1 2013')
    insert into Specific values (111,'Jan 1 2013',3, 'Mar 1 2013')
    insert into Specific values (112,'Jan 1 2013',1, 'Jan 1 2013')
    insert into Specific values (112,'Jan 1 2013',2, 'Feb 1 2013')
    insert into Specific values (113,'Jan 1 2013',1, 'Jan 1 1970')
    insert into Specific values (114,'Feb 1 2013',1, null)
    insert into Specific values (115,'Feb 1 2013',1, 'Jan 15 2013')
    insert into Specific values (115,'Feb 1 2013',2, 'Feb 15 2013')
    insert into Specific values (116,'Feb 1 2013',1, 'Jan 30 2013')
    insert into Specific values (116,'Feb 1 2013',2, 'Jan 1 1970')
    update A
    Set c_date = (Select MAX(d_date) From Specific B where A.a_id = B.a_id Group by a_id
    having MAX(d_date) is not null
    and MAX(d_date)<>'1970-01-01 00:00:00.000')
    From General A
    Select * From General
    Drop table general,specific
    This would cause all records in General table to get updated which is not what asker want
    see below statement
    I want to update General.c_date only when the values are null or Jan 1 1970
    from the maximum value of Specific.d_date as long as the maximum is not null or Jan 1 1970
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • How to show Min and Max values when another value "changes to a new value"

    Hi
    If I have this data (generated with this query: SELECT 1 A, 1 B UNION ALL SELECT 2, 1 UNION ALL SELECT 3, 2 UNION ALL SELECT 4, 2 UNION ALL SELECT 5, 1)
    A B
    1 1
    2 1
    3 2
    4 2
    5 1
    How can I generate this data (created with this query SELECT 1 Amin, 2 Amax, 1 B UNION ALL SELECT 3, 4, 2 UNION ALL SELECT 5, 5, 1)
    Amin Amax B
    1 2 1
    3 4 2
    5 5 1
    Thanks.

    Please post DDL, so that people do not have to guess what the keys, constraints, Declarative Referential Integrity, data types, etc. in your schema are. Learn how to follow ISO-11179 data element naming conventions and formatting rules. Temporal data should
    use ISO-8601 formats. Code should be in Standard SQL as much as possible and not local dialect. 
    This is minimal polite behavior on SQL forums. You also do not know the ANSI/ISO syntax for insertion and you did the old Sybase insertion kludge wrong, that we need keys, etc.
    CREATE TABLE Foobar
    (foo_seq INTEGER NOT NULL PRIMARY KEY,
     glop_score INTEGER NOT NULL);
    INSERT INTO Foobar
    VALUE
    (1,1),
    (2,1),
    (3,2),
    (4,2),
    (5,1);
    >> How can I generate this data (created with this query SELECT 1 Amin, 2 Amax, 1 B UNION ALL SELECT 3, 4, 2 UNION ALL SELECT 5, 5, 1) <<
    This makes no sense; you have the wrong syntax and mixed data types. My guess is: 
    SELECT MIN(foo_seg), MAX(foo_seq), MAX(glop_score)
      FROM Foobar
     GROUP BY glop_score
    HAVING MIN(glop_score) = MAX(glop_score); 
    Amin Amax B
    1 2 1
    3 4 2
    5 5 1
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • Iterative query to fetch from one column and insert/update in another colum

    i have a table with 5 columns as shown below
    Devicedetails
    userid ip deviceid makeby makedate
    123 100.00.20.11 | 00002011 xyz 10/11/2009
    456 102.03.21.12 | 02032112 def 11/12/2009
    678 null 02032112 def 11/12/2009
    896 111.22.33.44 02032112 def 11/12/2009
    in the above example i need to pick the value from deviceid - 022032112 and brake it in ot 02.03.21.12 (. after every tow digits) and prefix 1 (number one) at the end
    i am trying to write using cursor below not getting any idea
    1) I need to get the deviceid and subsctring it and update if the ip is there else insert

    SELECT REGEXP_REPLACE
              ('022032112',
               '([[:digit:]]{2})([[:digit:]]{2})([[:digit:]]{2})([[:digit:]]{2})([[:digit:]]{1})',
               '\1.\2.\3.\4.1\5'
              ) TEST
      FROM DUAL
    WHERE LENGTH ('022032112') = 9;o/p
    TEST
    02.20.32.11.12
    SELECT REGEXP_REPLACE
              ('02032112',
               '([[:digit:]]{2})([[:digit:]]{2})([[:digit:]]{2})([[:digit:]]{2})',
               '\1.\2.\3.1\4'
              ) TEST
      FROM DUAL
    WHERE LENGTH ('02032112') = 8;Edited by: DeepakDevarapalli on Nov 11, 2009 10:57 AM

  • How to select a value of a max value of another column in the same row?

    pversion pdate pcount
    1     11/6/2011     1
    0     11/6/2011     25
    1     11/6/2011     24
    How to select pversion for a maximum pcount, in this case max count is 25 and version will be 0?

    Like this?
    -- Data:
    with yourtable as
    select 1 pversion , 1 pcount from dual union all
    select 0 , 25 from dual union all
    select 1 , 24 from dual
    -- Query:
    select max(pversion ) keep (dense_rank last order by pcount) m_pversion
    from yourtable;(When you want to use the query with your real data, you will have to change 'yourtable' to your actual tablename)

  • Returning two rows with one column containing only one place

    Dear all;
    I have a query that returns two rows similar to this below
    ID      PLACE            PROGRAM
    A       NEWYORK      PROGRAM A
    A       NEWYORK      PROGRAM B
    I would like this instead
    ID      PLACE             PROGRAM
    A       NEWYORK       PROGRAM A
                                   PROGRAM  B
    All help is appreciated. Thank you.Edited by: user13328581 on Mar 22, 2011 11:52 AM

    user13328581 wrote:
    WOW...THanks a lot Solomon, I have never used partitions and row_number in such a manner...can you please explain your logic.Sure:
    row_number() over(partition by id order by place,program)This will take all rows returned by the query andsplit them into buckets (partitions) by id. Inside each bucket it will order rows by place and program and assign them row numbers. So for each ID row number 1 will be row with first (alphabetically) place first programt. And this is the row where we want ID to show up. That is why we wrap the above analytic function in CASE statement which will do exactly that. Now:
    row_number() over(partition by id,place order by program)does pretty much the same just bucket is ID and PLACE combination. So for each such combination we want to show only for the first (alphabetically) programt.
    Now notice in ORDER BY clause I prefix ID and PLACE with table alias. You must do it since otherwise query alias ID and PLACE will take precedence resulting in wrong sort order (remember we nulled all ID and PLACE except for row number 1).
    SY.

  • Need  trigger when update one column then record sysdate on another collumn

    Hi
    Gurus
    I have a table called RTV_PLAN
    And it have two columns,
    FORCE_KEYIN_FLAG VARCHAR(2)
    FORCE_KEYIN_DATE DATE
    I want when FORCE_KEYIN_FLAG get a value
    Then FORCE_KEYIN_DATE record the sysdate
    Please kindly give some help
    Many thanks
    saven

    Hi
    Justin
    thank you!
    It works for me very well.
    I use this code before
    <div class="jive-message-body"><div class="jive-quote"><span class="jive-quote-header"> if updating then
    </div>
    with your help my code is below now,
    <div class="jive-message-body"><div class="jive-quote"><span class="jive-quote-header">
    create or replace TRIGGER "RTV_PLAN_TRIG"
    before insert or update on RTV_PLAN
    for each row
    declare
    SCRAP_flag rtv_plan.SCRAP_flag%TYPE;
    force_keyin_flag rtv_plan.force_keyin_flag%TYPE;
    begin
    if inserting then
    if :NEW.RTV_PLAN_KEY is null then
    :NEW.RTV_PLAN_KEY := SAVEN.RTV_PLAN_api.RTV_gen_pk;
    end if;
    :NEW.dc_receive_date := sysdate;
    end if;
    if ( :new.scrap_flag IS NOT NULL ) then
    :NEW.SCRAP_date := sysdate;
    :NEW.SCRAP_USER := nvl(v('APP_USER'),USER);
    end if;
    if ( :new.force_keyin_flag IS NOT NULL )
    then
    :NEW.FORCE_KEYIN_date := sysdate;
    :NEW.FORCE_KEYIN_USER := nvl(v('APP_USER'),USER);
    end if;
    end;
    </div>
    can you checking this whether they have other error ?
    thank you
    saven

  • Help with lists and Numbers - how can I separate data from one column?

    I have a series of data entries that have two or three pieces of information listed in one column (it was a list copied from the Internet). My data is in this form all in one column (ie Column A):
    XXXX -- YYYY, ZZZZ
    I want to be able to easily split that data into three columns (A, B, and C) without having to go through and manually separate all of the entries? I'd ideally like to have XXXX in one column, the '--' removed, YYYY in another column, and ZZZZ in a third column, like this:
    Column A Column B Column C
    ====== ====== ======
    XXXX YYYY ZZZZ
    Is this possible? Any help is appreciated.

    BlooGoo
    Open or paste your material in your favorite texteditor. TextEdit will suffice but there are better applications. Make sure your material is consistent, especially that there are no stray characters or extra spaces studded in the text. You can do this by using the clean up routine as described below.
    1. Copy the set of characters you want to replace. In this case " -- " Note that there are spaces on each side of the dashes and you want to get rid of those.
    2. Open the *Find and Replace* dialogue:
    +Menu > Edit > Find > Find…+ (or command f)
    Paste the " -- " into the Find: field, then type a comma in the Replace: field or
    Copy and paste a tab from the document or
    Click on the Advanced button and enter a tab using the Insert… button that appears.
    3. Click *Replace All.*
    Repeat as necessary. If it doesn't seem to work, copy and paste the bits that stick, usually there is something not visibly different but different as far as the computer iust concerned.
    When you are finished save the results as a comma or tab delimited delimited .txt file and reopen it in Numbers.
    Peter

  • SSAS Tabular DAX- Need to get MAX value of the MIN (top)hierarchy level row

    EDIT:
    I got closer to resolving the issue using MAX. 
    However, If I remove the department hierarchy and just place on the MAX measure I get the single largest value out of all departments. 
    It would be ideal if the measure could still SUM the "top level" values across everything in the system if the hierarchy is not placed on the rows grouping.
    So it returns the largest value for a given department, but if the department hierarchy isn't present I need it to return a SUM of all the level 1 values for all departments...
    Basically return MAX value from the MIN L1ID's DeptLevel value, but I can't seem to construct that DAX query.  So if DepartmentID hierarchy is on display it gets MAX per row, but if that is removed it dips into MAX GoalValue for each L1ID grouping with
    the MIN DeptLevel.
    /EDIT
    I have a rather odd data table I'm bringing into a SSAS Tabular model.
    Instead of having all data at each child level and then it adding up to a grand total in the parent, it has a grand total predefined at each child level.
    I just need this tool to display the raw data if at all possible instead of trying to aggregate everything. Filter on active level, ignore child levels.
    Is there a way to do that?
    Example:
    SalesGoalsByDepartmentLevel:
    Level1 (top level) = 5,000
    Level2( lower level) = 0
    Level3(lower still) = 500
    Level 4(lowest) = 4,250
    So note that adding up all the child levels is still $250 shy of the top 5,000.
    IT is just an odd business rule, basically each level is expected to meet that goal or exceed it, the top level goal is 5,000 but management doesn't care where that last 250 comes from, they do are that each defined level is met.
    These levels are in a hierarchy so if I view the top level of the hierarchy it adds up to 4250+500+5000=9750 when I just want to see 5,000 at the top level and the details when they drill down.
    I added a filter to just filter to the top level, but then when I drill down of course those lower levels are blank.
    Is there a way to filter on the current displayed level without aggregating all child levels?
    Thanks!

    You might want to take a look at the Parent-Child Hierarchies pattern here:
    http://www.daxpatterns.com/parent-child-hierarchies/
    You might write DAX code to check what is the "current" level (see BrowseDepth measure in the sample file you can download) and depending on its level, se the filter to blank to all the levels below, so you don't aggregate "children".
    Just an idea, I'm not sure if it corresponds to your requirement and I don't have time to make more tests.
    I hope it will be helpful.
    Marco Russo (Blog,
    Twitter,
    LinkedIn) - sqlbi.com:
    Articles, Videos,
    Tools, Consultancy,
    Training
    Format with DAX Formatter and design with
    DAX Patterns. Learn
    Power Pivot and SSAS Tabular.

  • Multipal indexes on one column

    Hi,
    I have one table and in that table there are 5 columns. One column has 3 indexes and another column has 2 indexes.
    I want to know that if i create more indexes on one column, will performance of that database increase?
    Or if i remove the indexes means that if i keep one index on one column, will performance of that database decrease?
    Please suggest me what should i do for these indexes?
    Thanks in advance.
    Anand

    Performance is not increased just by adding indexes, it could even degrade if indexes are bad planned.
    A candidate column for indexing is the column mentioned on the where clause of a query. Once the candidate columns has been selected, the second filter is how selective it is, if it can be highly selective (ideal case unique values) then it can be indexed, otherwise (uneven distribution or low cardinality) it cannot be indexed by the regular method, on an uneven distribution column statistics have to be gathered; and on the low cardinality a bitmap index is advisable.
    There are many other circumstances where an index is not quite advisable, if you query by expression:
    where upper(column)
    or
    where numeric_col = '213'
    then you may have surprises finding that index is not being used. There are other tricks like query rewrite or function based index, but instead of going forward an specific statement has to be made on your side specifying concrete circumstances where you want to implement indexes.
    ~ Madrid.

  • Changing Date in one cell based on text in another cell

    Is there a formula to change the date in a cell in one column to the date in another column on the same row based on the text in a third cell on the same row? For example, I want the date in G3 to change to the date in J3 when the text in H3 says Completed.

    Hi,
    My understanding is that if the value of H3 is "Completed", the G3 is changed the value of J3, is it correct? If yes, we can use If formula (=IF(H2="completed",J2)), please see the image below:
    If no, please share us a sample, we'd like to re-try it.
    Regards,
    George Zhao
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.

  • From two given tables, how do you fetch the values from two columns using values from one column(get values from col.A if col.A is not null and get values from col.B if col.A is null)?

    From two given tables, how do you fetch the values from two columns using values from one column(get values from col.A if col.A is not null and get values from col.B if col.A is null)?

    Hi,
    Use NVL or COALESCE:
    NVL (col_a, col_b)
    Returns col_a if col_a is not NULL; otherwise, it returns col_b.
    Col_a and col_b must have similar (if not identical) datatypes; for example, if col_a is a DATE, then col_b can be another DATE or it can be a TIMESTAMP, but it can't be a VARCHAR2.
    For more about NVL and COALESCE, see the SQL Language manual: http://docs.oracle.com/cd/E11882_01/server.112/e26088/functions119.htm#sthref1310
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables involved, and also post the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    Always say which version of Oracle you're using (e.g., 11.2.0.2.0).
    See the forum FAQ: https://forums.oracle.com/message/9362002

  • How do I return a value from a column based on info from neighboring columns?

    I have a table of data that looks similar to this:
    Weight
    Name
    School
    Division
    106
    Name1
    School1
    1
    106
    Name2
    School2
    2
    106
    Name3
    School3
    3
    106
    Name4
    School4
    4
    113
    Name5
    School5
    1
    113
    Name6
    School6
    2
    113
    Name7
    School1
    3
    113
    Name8
    School3
    4
    It's a very large table, so there will be multiple matches for Schools, and occasionally a few matches for Names, but there will always be only one match for a given Weight and Division.
    In a separate table, how can I get the name of the person associated with the unique weight and division?
    In my head, the formula goes" "Look in the Weight column to find 106, then look in the Division column to find 4, then return the value from the Name column." But I can't figure out the formula that will do that.
    Any thoughts?

    Hi momogabi,
    This can be easily done with an index column.
    The formula I used in your original table for the index column is:
    =A2&"-"&D2. This was filled down. The column can be hidden.
    You can see the formula in the search table. If I wanted to eliminate the index column in that table the formula would look something like:
    =INDEX('Table 1-1'::B,MATCH(A2&"-"&B2,'Table 1-1'::E,0),1)
    Hope this helps.
    quinn

  • Retrieving multiple values from one column in SELECT statement

    Hi,
    I have a slight dilemma in that I'm trying to pull down all the values from a column from a select statement that includes some JOINS in it.
    If I run the query at the SQL Plus prompt, it pulls back all the values/rows.
    When I run the select (and prepared ) statement in my JSP, it only pulls back one of the 4 values I'm trying to retrieve.
    e.g.
    at the DB level :
    SELECT role_name, CC_ID FROM votetbl a
    INNER JOIN APPROVERS b ON
    a.BUSVP = b.BUSVP AND
    a.BRANCH = b.BRANCH
    WHERE CC_ID = 1688this will return:
    ROLE_NAME CC_ID
    ops 1688
    ops 1688
    comply 1688
    legal 1688
    comply 1688
    When run in my JSP, like so:
    String primID3a = request.getParameter("primID");
    Statement stmtovoter = connection.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY);
    String prepvotSQL = "SELECT role_name, CC_ID FROM votetbl a INNER JOIN APPROVERS b ON a.BUSVP = b.BUSVP AND " +
                         "a.BRANCH = b.BRANCH WHERE CC_ID = ?";
    PreparedStatement prepvotstmt = connection.prepareStatement(prepvotSQL);
    prepvotstmt.setString(1, primID3a);
    ResultSet rest3 = prepvotstmt.executeQuery();
    rest3.next();
    String votecat = rest3.getString(1);
    out.println("Vote category: "+votecat);I only get ops returned.
    Do I need to run an enumerator? Or reqest.getParameterValues or use a while statement around the results set?
    Any feedback and direction here is welcomed!
    Thanks!

    Actually, I tried looping and still only get 1, but returned several times.
    i.e.
    PreparedStatement prepvotstmt = connection.prepareStatement(prepvotSQL);
    prepvotstmt.setString(1, primID3a);
    ResultSet rest3 = prepvotstmt.executeQuery();
    rest3.next();
    String votecat = rest3.getString(1);
    while (rest3.next()) {
    out.print("category roles "+votecat);
    }then I get returned the following:
    admincategory roles admincategory roles admincategory roles admincategory roles admincategory roles admincategory roles admincategory roles admincategory roles admincategory roles admincategory roles admincategory roles admin
    like so.
    Where as at the DB level I get
    ROLE_NAME CC_ID
    admin 1688
    ops 1688
    ops 1688
    ops 1688
    ops 1688
    ops 1688
    ops 1688
    ops 1688
    risk 1688
    comply 1688
    legal 1688
    legal 1688
    ops 1688
    comply 1688
    Maybe the while should go around the getString(1) designation? But I was thinking I'd tried that and gotten invalid cursor error
    Something is definitely amiss, between the prepared statement in the servlet and the SELECT statement at the DB level.
    I can totally hardcode the statement in the servlet or JSP and it will return one value potentially several times, but only one.
    Other times, it will not return a value at all, even though one resides in the db.
    Yet go to the DB/SQL Plus prompt and it returns perfectly. I can simply copy and paste the SELECT statement from the out.print line I made and it works like a champ in SQL Plus. Any ideas why the same exact thing cannot return the proper values within the servlet/JSP?
    Yeeeeeeesh!!! : (
    Message was edited by:
    bpropes20

Maybe you are looking for

  • EXCISE GROUP H1 NOT RELEVENT FOR PLANTS IN PURCHAGE ORDER

    Dear All, While creating vendor excise invoice by Tcode: J1IEX it is throwing error AS MENTIONED BELOW, EXCISE GROUP H1 NOT RELEVENT FOR PLANTS IN PURCHAGE ORDER Kindly help in this matter. Regards AJIT K SINGH

  • Error while calling bpel process from jsp page

    Hi, I am trying to access bpel process from a jsp page..i could successfully deploy bpel and run it from bpel console.however accessing the bpel from a jsp gives an error. I have attached the code and error. I am using jdev10.3.1 with SOA suite.Any h

  • Report for all RAP advertisements with Package size.

    Hi, I have received a requirement to get the information about all the advertisements published in RAP along with package details like (Package Name/version/ and Package size). I have two different working reports, merging these two reports would suf

  • Std FM for Duplicate invoice posting

    Hi All Can any one send me the standard function modules which checks whether the INVOICE is parked or posted. (combination of company code/vendor/doc date/ref).

  • Indesign vs windows 7 and the internet

    Hi, I have a problem with the internet connection - every time I install indesign my connection to internet disappers. When I remove indesign the connection works again. I have windows 7 and I'm working with indesign CS3. Anyone out there with a theo