SELECT HTML statement

I try to use select statement in html, but it gives an error which is
16:50:21 PLS-00103: encountered the symbol "SELECT" at the expected in the following way:
16:50:21 PLS-00103: encountered the symbol "|"





' < html >
< table border = "1" >
< tr bgcolor = "Light Blue" >
< td > < b > ' | Select disconnect_cause in the rawticket_voip. "< /b > < table >
< td > < b > COL2 < /b > < table >
COL3 < td > < b > < /b > < table >
< /tr >
< /table >
< / html > "


How can I put a column it?

It works for me and I get the email

CREATE OR REPLACE PROCEDURE SEND_EMAIL IS
  V_FROM      VARCHAR2(80) := '[email protected]';
  V_RECIPIENT VARCHAR2(80) := '[email protected]';
  V_SUBJECT   VARCHAR2(80) := 'test subject';
  V_MAIL_HOST VARCHAR2(30) := 'localhost';
  V_MAIL_CONN UTL_SMTP.CONNECTION;
  CRLF        VARCHAR2(2) := CHR(13) || CHR(10);
  CURSOR CUR_ IS
    SELECT DISCONNECT_CAUSE FROM RAWTICKET_VOIP;
  W_DATA VARCHAR2(31000);

BEGIN
  V_MAIL_CONN := UTL_SMTP.OPEN_CONNECTION(V_MAIL_HOST, 25);
  UTL_SMTP.HELO(V_MAIL_CONN, V_MAIL_HOST);
  UTL_SMTP.MAIL(V_MAIL_CONN, V_FROM);
  UTL_SMTP.RCPT(V_MAIL_CONN, V_RECIPIENT);

  W_DATA := '
';
  FOR C IN CUR_ LOOP
    W_DATA := W_DATA || '';

  END LOOP;

  UTL_SMTP.DATA(V_MAIL_CONN,
                'Date: ' || TO_CHAR(SYSDATE, 'Dy, DD Mon YYYY hh24:mi:ss') || CRLF ||
                 'From: ' || V_FROM || CRLF || 'Subject: ' || V_SUBJECT || CRLF ||
                 'To: ' || V_RECIPIENT || CRLF || 'MIME-Version: 1.0' || CRLF ||
                 'Content-Type: text/html; charset="us-ascii"' || CRLF ||
                 W_DATA || '
' || C.DISCONNECT_CAUSE || '
' || CRLF); UTL_SMTP.QUIT(V_MAIL_CONN); EXCEPTION WHEN UTL_SMTP.TRANSIENT_ERROR OR UTL_SMTP.PERMANENT_ERROR THEN RAISE_APPLICATION_ERROR(-20000, 'Unable to send mail: ' || SQLERRM); END;

Tags: Database

Similar Questions

  • When I select HTML to create new, it appears in the Doc tab as untitled-1. XHTML

    Whenever I have select HTML to create new in the Welcome screen, it appears on the tab of the Document without title-1. XHTML, with a green icon.  In the past she always imagined as a document - 1.html, with no icon, like in my book.  I don't know why it does this, it's important (I assume it is), or how to change it.  I am new to Dreamweaver.  Any help would be appreciated...

    What version and build # DW don't you have?  You will find this under help > about Dreamweaver.

    Also the preferences you have specified for new documents?

    Go in Edition > Preferences > new Document.

    The default extension should be .htm, .html, .shtml or .php - according to the type of files, you are working with the most.

    Nancy O.

  • Problem in the development for the option selected in "Select" html

    Dear team,

    I created one, select the options for the creation of menu drop down say page main.html.

    on this page, I can able to choose and it's also show good selected item.

    I'm storage element currently selected in a variable using setSelectedPlayer() function call.

    This variable contains a correct value for the selected item.

    Now the problem is that when I go to someother page using 'pushscreen()', say on the layout.

    and then came back again to "main.html", but now my drop-down list contains default selected value and NOT my element selected.

    I tried to set using the option selected after the loading of the page.

    document.getElementById('customDropDown').selectedIndex = selectedPlayer;

    document.getElementById('customDropDown').setSelectedItem (2); = selectedPlayer;

    document.getElementById('customDropDown').options [selectedPlayer] .selected = true;

    but the emphasis is always on the 'default' option. Note that the selected internal value is correct. I mean to say, I chose 2nd option then after coming back from the 'Settings' page, I'm still not able to select the 2nd option but the emphasis is on the default option.

    Please help me I'm really stuck for that little thing.

    We hope to get answer soon.

    Thank you.

    Use the setSelectedText method. This example is a similar thing: https://github.com/blackberry/BB10-WebWorks-Samples/blob/master/Sensors/index.html#L53

  • SELECT SQLite statement failed

    I've reached the point where I need to crowd source this error.

    I try to run the following code:

    uri = URI.create("file://" + _optionsData.getStorageURI() +     OptionsData.DB_NAME);
    sqliteDB = DatabaseFactory.open(uri);
    Statement st = sqliteDB.createStatement("SELECT * FROM foo");
    st.prepare();
    Cursor c = st.getCursor();
    Row r = c.getRow();
    int size = r.getInteger(0);
    

    Creates the URI end to the database of opening works very well.  The statement is prepared.  However, when I get the cursor, it is 'empty', containing no information line or column.  c.getRow () returns a NULL reference and the following statement fails with a special Null pointer.

    The SQL code has been checked with a SQLite spy program to the same database.

    To check that I have all correct on the connection to the database, I changed the code to make an INSERT using st.execute (), and the values inserted in the database.  Verified by SQLite Spy.

    It will fail in the same way on the 9700 "Bold" standard simulator that comes with the Eclipse plugin and the specific Storm 2 Add-on Verizon Simulator.

    Any suggestions?

    Solved my problem.

    The code snippet, before you start changing things to try to understand what wasn't in question a "SELECT MAX (id) foo" call.  Thus, it only returns a single line.

    I come from a background of Perl/MySQL, and I didn't know that when you have a line that is returned, you should always call the next() on a cursor before it will be initialized.  Therefore, the above code should read as follows:

    Statement st = sqliteDB.createStatement("SELECT MAX(id) FROM foo");
    st.prepare();
    Cursor c = st.getCursor();
    if (c.next()){
        Row r = c.getRow();
        int size = r.getInteger(0);
    }
    

    When c.next () is called, the cursor is on the first line.

  • Panel with a &lt; select &gt; html form gets clipped

    Hello

    I want to have a form < select > choose from a long list of options, but my list gets cut on the bottom edge of my Panel. in a browser, the list fleet out of the window of the browser and if it does not fit on the screen, then it becomes scrollable. But in Illustrator, it ends just at the edge of the Panel.

    I made this script with a panel of js and it works as expected. However I am trying to do an extension, and I can't get past this little problem.

    I know that I can make a list scroll but box containing more real state and it is not ideal. It is harder to find your selection and harder to scroll. I really want to have a form of selection.

    Anyway, if anyone has any ideas on a solution that would be appreciated. Thank you

    I'm on cc 2015 on mac.

    has me a little confused. and I don't have a mac, I can test.

    the size attribute would provide a work around?

    It hangs, then a number of display options, add a scroll bar to access others.

    is not ideal but maybe an option...

  • conditional select into statement


    Hi people.

    I'm trying to implement a conditional block in a select statement. I browsed the forums and seen the suggestions with the DECODING and the recurrent insistence that IF/ELSE do not or cannot work within the PL/SQL, which is what it would be.

    I'm trying to connect a simple string value if the value of a column is null. The block WHEN either does not either or I'm doing it wrong, but I would take any suggestions that you that you better informed than me on this.

    Here is the block:

    ------------------

    SELECT c.CHCTRLID 'CC ID', c.STATUS3, b.VPTIMSTAMP,
    a.VP_DATE AS 'Submit Date', a.CRITI_EXP_DT AS 'Critical Date', c.REQ_TYPE, c.SUBJLETTER,

    c.PGCOUNT AS 'Total Page', c.EFFECT_PGCOUNT,
    c.PUBTYPE AS "Type of Publication", c.COMPLEXITYLEVEL,.
    c.PUBDATE, a.BRANCH, a.BRANCH_SEC, a.PRIORITY, c.WRITER, a.REQ_INFO_DESCRIPT, a.DEPT,

    ABS (Round ((pubDate-VPTIMSTAMP), 0)) AS 'level of SLA in days. "

    -WHEN PUBDATE IS NULL
    - then return "n/a" AS "secondary ALS."
    -WHILE OTHERS THEN
    -BACK Abs (Round (SYSDATE-VPTIMSTAMP), 0)) AS 'secondary ALS. "

    a.OPS_MAN_CHG, a.OPS_MAN_PPCHAP, a.STRATEGY_UPDATE, a.CRITICAL_EXP

    B INNER JOIN CHG_CTRL_USR one CHG_CTRL_ADM
    ON b.CHCTRLID = a.CHCTRLID
    C INNER JOIN ADM_SUPP_INDX ON b.CHCTRLID = c.CHCTRLID

    WHERE c.STATUS3! = 'Cancelled' AND a.VP_DATE > 4 April 11 '
    ORDER BY a.CHCTRLID

    ---------------------------

    I commented on the block ONCE because it wouldn't work, but basically, that's what I'm trying to accomplish.

    Thank you.

    Decode is possible, but the CASE is more readable.

    Try this as a column value

    CASE WHEN PUBDATE IS NULL
      then 'n/a'
        else to_char(Abs(Round(SYSDATE-VPTIMSTAMP),0)) )  end AS "Secondary SLA",
    

    second possibility to check NULL is use NVL or NVL2.

    The data type of these two results must match.

    NVL2

    as in

    nvl2(PUBDATE, to_char(Abs(Round(SYSDATE-VPTIMSTAMP))) , 'n/a')
    
  • Select SQL statement - See all the value of the range of month of entry

    Hi all

    I have a vision that is a union of other views
    But the description of the view is as below
    desc dashboard_monthly_view
    Name                           Null Type         
    ------------------------------ ---- ------------ 
    MONTHS                              VARCHAR2(17) 
    NUM_DEPENDENT_IN_ASSESSMENT         NUMBER       
    NUM_REFERRED_AODTC                  NUMBER       
    NUM_AT_DETERMINATION_HEARING        NUMBER       
    NUM_ACCEPTED                        NUMBER       
    NUM_NOT_ACCEPTED                    NUMBER       
    NUM_EXITED_SUCCESS                  NUMBER       
    AVERAGE_DAY_TO_EXIST                NUMBER       
    NUM_EXITED_UNSUCCESS                NUMBER       
    AVERAGE_DAY_TO_EXIST_UNSUCCESS      NUMBER       
    COURT_NAME                          VARCHAR2(9)  
    -current data in the view
    MONTHS            NUM_DEPENDENT_IN_ASSESSMENT NUM_REFERRED_AODTC     NUM_AT_DETERMINATION_HEARING NUM_ACCEPTED           NUM_NOT_ACCEPTED       NUM_EXITED_SUCCESS     AVERAGE_DAY_TO_EXIST   NUM_EXITED_UNSUCCESS   AVERAGE_DAY_TO_EXIST_UNSUCCESS COURT_NAME 
    ----------------- --------------------------- ---------------------- ---------------------------- ---------------------- ---------------------- ---------------------- ---------------------- ---------------------- ------------------------------ ---------- 
    AUG 2012          1                           0                      0                            0                      0                      0                      0                      0                      0                              AAA   
    OCT 2012          8                           1                      3                            1                      1                      1                      44                     1                      4                              AAA   
    SEP 2012          2                           0                      2                            2                      0                      0                      0                      0                      0                              AAA   
    *UNDEFINED*       0                           11                     7                            1                      1                      0                      0                      1                      0                              AAA   
    NOV 2012          0                           0                      0                            0                      0                      0                      0                      1                      54                             BBB  
    OCT 2012          4                           1                      2                            1                      1                      1                      9                      0                      0                              BBB  
    SEP 2012          1                           0                      0                            0                      0                      1                      14                     0                      0                              BBB  
    *UNDEFINED*       0                           5                      4                            1                      0                      0                      0                      1                      0                              BBB  
    AUG 2012          1                           0                      0                            0                      0                      0                      0                      0                      0                              COMBINED   
    NOV 2012          0                           0                      0                            0                      0                      0                      0                      1                      54                             COMBINED   
    OCT 2012          12                          2                      5                            2                      2                      2                      26.5                   1                      4                              COMBINED   
    SEP 2012          3                           0                      2                            2                      0                      1                      14                     0                      0                              COMBINED   
    *UNDEFINED*       0                           16                     11                           2                      1                      0                      0                      2                      0                              COMBINED   
    
     13 rows selected 
     
    -My select query is
     DEFINE startmonth = "Aug 2012";
    DEFINE endmonth   = "Nov 2012";
    with all_months as
    ( select to_char(which_month, 'MON YYYY') month from
      (select
            add_months(to_date('&startmonth','MON YYYY'), rownum-1) which_month
        from
            all_objects
        where
            rownum <= months_between(to_date(NVL('&endmonth', '&startmonth'),'MON YYYY'), add_months(to_date('&startmonth','MON YYYY'), -1))
        order by
            which_month )
    )
    
    select nvl(months, '**ALL**')    AS "MONTHS", TO_DATE(MONTHS, 'MON YYYY') AS MONTH_SORT
        , sum(num_dependent_in_assessment)    AS num_dependent_in_assessment
        , sum(num_referred_aodtc)    AS num_referred_aodtc
        , sum(num_at_determination_hearing) as num_at_determination_hearing
        , sum(num_accepted) AS num_accepted
        , sum (num_not_accepted) AS num_not_accepted
        , sum(num_exited_success) as num_exited_success
        , sum(average_day_to_exist) as average_day_to_exist
        , sum(num_exited_unsuccess) as num_exited_unsuccess
        , sum (average_day_to_exist_unsuccess) as average_day_to_exist_unsuccess
    from 
      DASHBOARD_MONTHLY_VIEW    right outer join all_months
      on DASHBOARD_MONTHLY_VIEW.months = all_months.month
    --where months in (select month from all_months)
      and upper(court_name) like 'AAA'
    group by (months)
    order by month_sort
     
    - And the result is
    MONTHS            MONTH_SORT                NUM_DEPENDENT_IN_ASSESSMENT NUM_REFERRED_AODTC     NUM_AT_DETERMINATION_HEARING NUM_ACCEPTED           NUM_NOT_ACCEPTED       NUM_EXITED_SUCCESS     AVERAGE_DAY_TO_EXIST   NUM_EXITED_UNSUCCESS   AVERAGE_DAY_TO_EXIST_UNSUCCESS 
    ----------------- ------------------------- --------------------------- ---------------------- ---------------------------- ---------------------- ---------------------- ---------------------- ---------------------- ---------------------- ------------------------------ 
    AUG 2012          01/08/12                  1                           0                      0                            0                      0                      0                      0                      0                      0                              
    SEP 2012          01/09/12                  2                           0                      2                            2                      0                      0                      0                      0                      0                              
    OCT 2012          01/10/12                  8                           1                      3                            1                      1                      1                      44                     1                      4                              
    **ALL**                                                                                                                                                                                                                                                                       
    
     
    -The requirement of results I have to produce is
    MONTHS            MONTH_SORT                NUM_DEPENDENT_IN_ASSESSMENT NUM_REFERRED_AODTC     NUM_AT_DETERMINATION_HEARING NUM_ACCEPTED           NUM_NOT_ACCEPTED       NUM_EXITED_SUCCESS     AVERAGE_DAY_TO_EXIST   NUM_EXITED_UNSUCCESS   AVERAGE_DAY_TO_EXIST_UNSUCCESS 
    ----------------- ------------------------- --------------------------- ---------------------- ---------------------------- ---------------------- ---------------------- ---------------------- ---------------------- ---------------------- ------------------------------ 
    AUG 2012          01/08/12                  1                           0                      0                            0                      0                      0                      0                      0                      0                              
    SEP 2012          01/09/12                  2                           0                      2                            2                      0                      0                      0                      0                      0                              
    OCT 2012          01/10/12                  8                           1                      3                            1                      1                      1                      44                     1                      4                              
    NOV 2012          01/11/12                  0                           0                      0                            0                      0                      0                      0                      0                      0                          
    **ALL**
     
    On the tota (* EVERYTHING *) l, I tried to use the rollup but he total average too, which is not correct. I think the reason because he cannot read the form that was used to calculate the column.
    How can I fix this, should I create, select another below one, with the sum of each column and the average for the other columns.
    Also, the business analyst want to show all the months between the start and end of the month.
    I used the right outer join, but apparently does not produce the right result.
    If anyone of you have any ideas, please advise.
    We use Oracle 11 g, it is a select statement for an Oracle APEX report.
    The APEX version is 4.0.2. I'm a junior developer of the APEX and I still have to learn a lot about SQL Oracle analytic function.

    Thank you very much in advance.

    Ann

    Hi, Ann.

    Ann586341 wrote:
    ... I created a table to contain a simplified version of this view

    Thank you. It is much easier to work with.

    ... My query is

    DEFINE startmonth = "Aug 2012";
    DEFINE endmonth   = "Nov 2012";
    with all_months as
    ( select to_char(which_month, 'MON YYYY') month from
    (select
    add_months(to_date('&startmonth','MON YYYY'), rownum-1) which_month
    from
    all_objects
    where
    rownum <= months_between(to_date(NVL('&endmonth', '&startmonth'),'MON YYYY'), add_months(to_date('&startmonth','MON YYYY'), -1))
    order by
    which_month )
    )
    , tbl_dashboard_active as
    ( select *
    from tbl_dashboard_monthly
    where months != '**UNDEFINED**' )
    
    select tbl.months    AS "MONTHS" --, TO_DATE(tbl.MONTHS, 'MON YYYY') AS MONTH_SORT
    , tbl.num_hearing
    , tbl.num_exited_success
    , tbl.avg_day_success_exist
    , tbl.num_exited_unsuccess
    , tbl.avg_day_unsuccess_exist
    
    from
    tbl_dashboard_active  tbl right outer join all_months am
    on tbl.months = am.month
    and upper(tbl.court_name) like 'BBB'
    
    UNION ALL
    
    select 'ALL'    AS "TOTAL"
    , SUM(tbl.num_hearing)
    , SUM(tbl.num_exited_success)
    , round(AVG(tbl.avg_day_success_exist),2)
    , SUM(tbl.num_exited_unsuccess)
    , round(AVG(tbl.avg_day_unsuccess_exist),2)
    --order by to_date(am.month,'MON YYYY')
    
    from
    tbl_dashboard_monthly  tbl right outer join all_months am
    on tbl.months = am.month
    and upper(tbl.court_name) like 'BBB'
    

    - And the result I got

    MONTHS            NUM_HEARING NUM_EXITED_SUCCESS AVG_DAY_SUCCESS_EXIST NUM_EXITED_UNSUCCESS AVG_DAY_UNSUCCESS_EXIST
    ----------------- ----------- ------------------ --------------------- -------------------- -----------------------
    AUG 2012                    1                  0                     0                    0                       0
    OCT 2012                    1                  0                     0                    2                      35
    SEP 2012                    1                  0                     0                    0                       0 
    
    ALL                         3                  0                     0                    2                   11.67 
    

    I don't know why even I already filter all lines that the month is undefined, I still have a blank line in the result set.

    This is the line for November. You do an outer join, in order to ensure that each value of am.month is displayed, even if it does not match what anyone in tbl. When it does not match anything, then all the columns tbl is supposed to provide will be NULL. You decide to view tbl. months, which is one of the following columns will be NULL. You should display mod. monmth instead.

    But if I run for handset Court, I don't see this problem. The reason is that the Court combined have given for all four months?

    When you say "on behalf of the combined Court", do you mean the unconditional "upper (tbl.court_name) as"BBB "?
    If Yes, that would explain it.

    Also is it possible to list all the months between the start and end month assuring the user even if the statistics are 0.

    Once again, in the case of lines that are present, even if they do not have the status of outer join, all of these columns will be NULL. Use NVL to map these nulls to 0.

    and how to sort the month

    GROUP OF two expressions, which depend on each other: one for sorting and the other for display.
    For the sort expression, you can use months as a DATE. (It seems that you have tried this, but commented on the ORDER BY clause in your query is before the FROM clause.) The ORDER BY clause is always at the end of the query, after the FROM clause.)
    Another expression of sorting is the number you used to generate the first month. That's what I used below.

    Here's a way to get the results you requested:

    WITH   got_months    AS
    (
         SELECT     TO_DATE ('&startmonth', 'Mon YYYY')     AS startmonth_dt
         ,     TO_DATE ( NVL ( '&endmonth'
                         , '&startmonth'
                         )
                   , 'Mon YYYY'
                   )                    AS endmonth_dt
         FROM    dual
    )
    ,     all_months     AS
    (
         SELECT  rownum               AS month_num
         ,     TO_CHAR ( ADD_MONTHS ( m.startmonth_dt
                                , ROWNUM - 1
                             )
                   , 'MON YYYY'
                   )              AS months
         FROM        got_months  m
         CROSS JOIN  all_objects
         WHERE     ROWNUM <= 1 + MONTHS_BETWEEN ( m.endmonth_dt
                                              , m.startmonth_dt
                                  )
    )
    SELECT    NVL ( am.months
               , 'All'
               )                              AS months
    ,        SUM (NVL (tbl.num_hearing,             0))     AS num_hearing
    ,        SUM (NVL (tbl.num_exited_success,      0))     AS num_exited_success
    ,       AVG (NVL (tbl.avg_day_success_exist,   0))     AS avg_day_success_exist
    ,       SUM (NVL (tbl.num_exited_unsuccess,    0))     AS num_exited_unsuccess
    ,       AVG (NVL (tbl.avg_day_unsuccess_exist, 0))     AS avg_day_unsuccess_exist
    FROM              all_months          am
    LEFT OUTER JOIN      tbl_dashboard_monthly  tbl  ON  am.months           = tbl.months
                                           AND  UPPER (tbl.court_name) = 'BBB'
    GROUP BY  GROUPING SETS ( (am.month_num, am.months)
                              , ()
                   )
    ORDER BY  am.month_num
    ;
    

    Again, I used two GROUP BY expressions: one for sorting, the other for display. These depend on each other, that is, given one, you could derive from each other, and it is not sensible to dependent ROLLUP GROUP BY expressions like that, so I used GROUPING SETS ROLLUP instead, so it would be only 1 rank of great aggregate (in other words, 'all').

    Output:

    `                               AVG_                 AVG_
                         NUM_       DAY_      NUM_       DAY_
                 NUM_ EXITED_    SUCCESS   EXITED_  UNSUCCESS
    MONTHS    HEARING SUCCESS     _EXIST UNSUCCESS     _EXIST
    --------- ------- ------- ---------- --------- ----------
    AUG 2012        1       0          0         0          0
    SEP 2012        1       0          0         0          0
    OCT 2012        1       0          0         2         35
    NOV 2012        0       0          0         0          0
    All             3       0          0         2       8.75
    
  • 'Go to the State' vs 'Go to the next State' for the selected button state

    I have a series of image galleries in my publication that uses MSOs and buttons to "Go to another" - the thumbnails then have a small edge to have indicated that they are 'selected' - it works very well. The border is added to the click for each thumbnail button state.

    I have a similar scenario is a YouTube embed of the video and an article as a MSO with two States: a State is the vid to youtube and the other State is the article of the text. I have a set place button to switch between these two States. This button is set to "Go to the next State" so he'll just between the two States MSO. Is there any way to have a selected State for this button so that the words under the button change to 'play' video in 'see article' while keeping this button set to "Go to the next State" - the only way I can think to do is with two buttons.

    I realize, this is a very specific use case and I do not expect the features, but if there is a solution I am curious to know if anyone else has come across this.

    Thanks in advance for your help.

    Implement for the buttons in the different States. Then add an invisible button on it to the next State meetings.

    Bob

  • Selecting correct state in the drop-down list.

    Here is my delima. I have a form that gets repopulate when users come back to update their contact information. Name, address, etc. of the State. What I am having a problem with performs their State to be selected from a drop-down list. For example, if I'm from Ohio, so I want Ohio selected in the drop-down list. I don't want the user to have to select again the State if the information has not changed. Here's an example of how it is formatted.

    < select tabIndex = "5" name = "State" >
    < option value = "" selected = "selected" > < / option > "
    < option value = 'AL' > Alabama < / option >
    < option value = "AK" > Alaska < / option >
    < option value = "AZ" > Arizona < / option >
    < option value = "AR" > Arkansas < / option >
    < option value = "CA" > California < / option >
    < option value = "CO" > Colorado < / option >

    Of course, the two-letter abbreviation is written and retrieved from the database.
    Everyone works with this before?
    Any help/information is appreciated.
    Brian

    Here's how I made this...

    Top of the page put

    Then, when comes the time to put the list do that...

    I hope this helps.

  • Select a statement creating problem

    Hi guys!

    I am trying to build a select statement as follows:

    SELECT name, age, country
    People
    WHERE
    THERE ARE
    (SELECT cu.name, cu.age
    CUSTOMER cu
    WHERE
    Cu.Name LIKE '% Mike % '.
    AND cu.country LIKE '% two % '.
    )

    as you can see I'm trying to get the name, the age... of a table when these data exist in another table, the problem is that I need to do it this way, I can not change the name of the PEOPLE table or add an alias, I think I should add something like would take him IN, but I don't remember how to do it.

    If anyone can help me it would be much appreciated.

    THX

    Clause EXISTS needs a subquery related Co. You will need to create a join between the table 'people' and 'customer '.

    WHERE
    THERE ARE
    (SELECT cu.name, cu.age
    CUSTOMER cu
    WHERE
    Cu.Name LIKE '% Mike % '.
    AND cu.country LIKE '% two % '.
    AND CU.NAME = PEOPLE.NAME
    AND CU. AGE = PEOPLE. AGE
    )

    Otherwise, you could use operator as

    WHERE
    (NAME, AGE) IN
    (SELECT cu.name, cu.age
    CUSTOMER cu
    WHERE
    Cu.Name LIKE '% Mike % '.
    AND cu.country LIKE '% two % '.
    )

  • Query internal within a select if statement

    I would like to know how to write an if condition inside a select statement of the present
    b.inventory_item_id in(
                select distinct inventoryid
                from lcm.sis_inventario_new
                where fec_envio > to_date('28/01/2010','DD/MM/YYYY'))
    I mean something like
    select b.inventory_item_id as id, 
           b.segment1 as c,
           b.segment2 as "Código",
           b.description as "Descripción", 
           tl.description as "Descripción Larga", 
           b.attribute1 as "Descripción Corta",
           c.segment1 as "Departamento",c.segment2 as "Familia", c.segment3 as "Subfamilia",
           b.creation_date as "Creado",
           b.INVENTORY_ITEM_STATUS_CODE as "Status",
           case b.attribute5 when '4' then 'Si' else 'No' end as "Pesado",
           case b.inventory_item_id when in  select distinct inventoryid
                from lcm.sis_inventario_new
                where fec_envio > to_date('28/01/2010','DD/MM/YYYY')) then 'Si' else 'No' end as "Existe"

    There are a number of ways, and the best solution for you will depend on several factors, including the index, the number of rows in the tables, etc..

    Go using analytical functions;

    with b as (
       select rownum inventory_item_id from dual
       connect by rownum <=2),
    lcm as (
       select 1 inventoryid, to_date('28/01/2000', 'DD/MM/YYYY') fec_envio from dual union all
       select 1, to_date('31/12/2010', 'DD/MM/YYYY') from dual union all
       select 2, to_date('28/01/2000', 'DD/MM/YYYY') from dual union all
       select 2, to_date('28/01/2008', 'DD/MM/YYYY') from dual)
    select b.inventory_item_id id,
           case
              when max(fec_envio) over(partition by b.inventory_item_id) >
                   to_date('28/01/2010', 'DD/MM/YYYY') then
               'Si'
              else
               'No'
            end as existe
    from b, lcm
    where b.inventory_item_id = lcm.inventoryid;
    
            ID EXISTE
    ---------- ------
             1 Si
             1 Si
             2 No
             2 No
    
  • How to write a delete with select sub statement?

    Hello
    Is it possible to change the bottom of construction to be more effective by writing a delete statement that uses a subselect with the statement inside the loop?
     my_current_date_time := TRUNC(in_start_date_time);
           
           DELETE FROM inclusion_table;
     
      LOOP
        
         EXIT WHEN my_current_date_time >= in_end_date_time;
           
         INSERT INTO inclusion_table (
                     date_time )
          VALUES (my_current_date_time);
          
                
          my_current_date_time := my_current_date_time + numtodsinterval(1, 'DAY');
                   
      END LOOP
    Thank you.

    Just add the code to the Code of the Christian

    SQL > declare
    2 start_Date Date: = to_date ('2009-12-06', ' dd/mm/yyyy');
    End_date Date 3: = trunc (sysdate);
    4 Begin
    {color: blue} 5 EXECUTE IMMEDIATE 'TRUNCATE TABLE inclusion_table; {color}
    6 INSERT INTO inclusion_table
    7 (SELECT start_date - 1 + level as Date_Time
    8 DOUBLE
    9 connect BY level<= 1="" +="" end_date="" -="">
    10 commit;
    11 end;
    12.

    SS

  • Select output statement

    Hello

    I'm getting out my select query. I can align the colum as output:

    Statement:

    Select substr(billdate,1,6), speciality, count (*) in the ipbill where billdate > = '20090401' and billdate < = '20090531'

    IAM get the result below:


    200904 CARDIOLOGY 10

    200904 UROLOGY 20

    200905 20 CARDIOLOGY

    200905 30 UROLOGY

    Is it possible to align my output as below, because it will be helpuful for ease of analysis:


    200904 200905

    10 20 CARDIOLOGY

    20 30 UROLOGY


    Thank you
    Satya

    The number of specialties is flexible, the months are not. These must be in "hard"; for each month, you need to create a column.

    What is the result, which means what frontend tool do you use to create this report. Most reporting frontend tools have a function PIVOT (as Excel - Oracle reports etc.)

  • Select the statement and the Group of

    Hi all

    I have this code to display the total number of orders by customer id:

    Select customer_id, sum (order_total) total

    of demo_orders

    Customer_id group;

    and it gives me this result:

    CUSTOMER_ID TOTAL

    ----------- ----------

    1 2380

    2 2370

    3 2420

    4 1060

    5 1090

    6 950

    7 2760

    7 selected lines.

    But instead of the ID, I want to display their names, like this:

    CUSTOMER TOTAL

    Brown, John 3450

    ... and so on

    How do I do that?

    I know I can't include these columns concatenated in the selection list, because I would have to be included in the GROUP BY clause...

    Thank you.

    I know I can't include these columns concatenated in the selection list, because I would have to include it in the

    Huh? Why not you. Have you actually tried it?

    Just do what you say - include names concatenated in the select group of clauses.

    Or you can just join the query you have each other to get the names, since we have no idea where the names are still stored. If they are in the same table as the ID then just use the solution "you know you can't do '!

  • &lt; Select &gt; HTML options are cut

    Currently a < select > elements in the current workspace are cut when they go at the bottom of the window.  This is correct behavior in Chrome (the browser embedded in the window of Adobe extension), but the extension window containing Adobe cut everything that extends beyond the bottom of the main window.

    It is the expected behavior.

Maybe you are looking for

  • While with PXI-5122 digitizer loop counter

    Hello world I am a beginner of products NOR. Currently I use the PXI-5122, 2014 Labview for the ultrasonic signals. I have a problem when you count the number of signals using an external trigger (by a function generator) source. When I trigger the d

  • HP touchsmart 310-1145ukpc: motherboard update

    Hi there, can anyone tell me if I can improve my motherboard on my TouchSmart 310 1145uk computer if yes what I can go to that will work with this pc, I can go up to a card mother i5. Thank you very much alsithy 48

  • INK JET CARTRIDGES

    I had a printer P513w for which I have replacement series 22 Dell cartridges. I have now bought a V313w who seems to have the same print as the P513 head. I note, however, that the cartridges are labeled "series 21" for the V313w and "series 22" for

  • Locked out-forgotten admin password

    I have a fancy notebook m6 and when I turn a blue screen appears asking an administrator password. I tried several times and then it says system off and give the code 85508345. Is there a way to reset the password?

  • RSS feed of rendering

    Hi all I made the content of normal url on the screen using the example provided with jde4.5. all I want to know is how to render the content of the RSS feeds on the screen. an example would help. Thanks in advance