Why this query SQLLite returns the same all the time?

Hello

I use a search box to accept a query on three columns and am page before based on the last record, which in this case is Run Baby Run by Loopy

I know for a fact that the database has a song inside by Loopy called Straight Down the Line, so this should at least be showing that. But it does is display the same songs again.

Can someone explain the error in my logic here?

SELECT * WHERE DiscID AS "loopy %" songs or artist LIKE 'loopy %' or AS "loopy %" title AND artist > = 'LOOPY' COLLATE NOCASE Title > = 'Run Baby Run' COLLATE NOCASE ORDER BY artist COLLATE NOCASE ASC, title COLLATE NOCASE ASC LIMIT 20

Thanks for taking a peek.

This is a forum for AS3, not SQL - etc., which may explain the slow Pickup on your ad.  While someone might offer something at some point, you should try to find a forum where they discuss SQL programming, which could mean going out of the domain of Adobe.  The closest thing I can think that would be a forum in the Adobe forums game...

http://forums.Adobe.com/community/Dreamweaver/server_side

Tags: Adobe Animate

Similar Questions

  • Why this query can remove duplicates?

    Why this query can remove duplicates? Can someone give me detailed explanation?

    Thank you
    select salary from employees union select salary from employees;

    Hello

    See the docs.

    ' Example of the UNION
    The following statement combines the results of two queries with the UNION operator which eliminates duplicates of selected lines.
    "This statement shows that you must match the data type (using the function TO_CHAR) when the columns do not exist in one or the other table"

    http://download.Oracle.com/docs/CD/B19306_01/server.102/b14200/queries004.htm#i2054381

    Edit

    Here's another interpretation of your question:

    http://asktom.Oracle.com/pls/asktom/f?p=100:11:0:P11_QUESTION_ID:1224636375004

    Published by: hoek on October 22, 2009 17:40

  • Why this query produces no output?

    Why this query produces no output?
    select * from
    (
    SELECT 40 as startvalue, (24 * 60)*(To_Date('00:40', 'HH24:MI') - To_Date('00:00', 'HH24:MI')) as c
    FROM dual di
    ) q
    where q.c = q.startvalue

    And just to show that it works if round you...

    SQL> ed
    Wrote file afiedt.buf
    
      1  select * from
      2  (
      3  SELECT 40 as startvalue, round((24 * 60)*(To_Date('00:40', 'HH24:MI') - To_Date('00:00', 'HH24:MI')),0) as c
      4  FROM dual di
      5  ) q
      6* where q.c = q.startvalue
    SQL> /
    
    STARTVALUE          C
    ---------- ----------
            40         40
    

    I certainly wouldn't say using TRIM as PS has suggested. TRIM is a string function, not a digital function.

  • How to rewrite this query to get the correct results?

    Friends,

    DB: 9iR2

    I need to get the name of the employee and the employee number that are not in the table of presence.
    but this query is not the right answer.
    select e.eno,e.ename from empl e
    where e.eno not in (select a.eno from attendance a)
    Thank you

    Depending on your data

    SQL> create table attendance(
      2  ENO   VARCHAR2(5),
      3   TDATE VARCHAR2(10),
      4   IN_TIME  VARCHAR2(6),
      5   OUT_TIME VARCHAR2(6),
      6   SHIFT_NO  NUMBER(1));
    
    Table created.
    
    SQL>  create table empl(
      2   ENO VARCHAR2(5),
      3   ENAME  VARCHAR2(75));
    
    Table created.
    
    SQL> insert into empl values('11','AA');
    
    1 row created.
    
    SQL>   insert into empl values('12','AB');
    
    1 row created.
    
    SQL>    insert into empl values('13','AC');
    
    1 row created.
    
    SQL>     insert into empl values('14','AD');
    
    1 row created.
    
    SQL>   insert into empl values('15','AF');
    
    1 row created.
    
    SQL>  insert into attendance values('11','23-3-2009','9.00','6.00',1);
    
    1 row created.
    
    SQL>  insert into attendance values('14','24-3-2009','9.00','6.00',1);
    
    1 row created.
    
    SQL>  insert into attendance values('11','25-3-2009','9.00','6.00',1);
    
    1 row created.
    
    SQL>  insert into attendance values('13','23-3-2009','9.00','6.00',1);
    
    1 row created.
    
    SQL>  insert into attendance values('15','23-3-2009','9.00','6.00',1);
    
    1 row created.
    
    SQL> commit;
    
    Commit complete.
    
    select e.eno,e.ename
    from empl e
    where not exists(select 1 from attendance a where a.eno=e.eno);
    
    ENO     ENAME
    
    12     AB
    

    Twinkle

  • I need a query that returns the average amount of characters from text colum in MS SQL.

    I need a query that returns the average amount of characters from text colum in MS SQL.

    Could someone show me how?

    Sorting, I need of the

    DATALENGTH

    function

  • Windows Defender encountered an error: 0x800705b4. This operation completed because the time-out period night.

    Hello

    I'm a Microsoft Online Customer Service, which contacts on behalf of my client. It lights its Windows Defender and received this error message below:

    «Windows defender encountered an error: 0x800705b4.» This operation completed because the time-out period night. »

    Hello

    ·         You have a third-party security software installed on the computer?

    Method 1:

    If so then try to disable the antivirus and then check to see if you can turn on Windows Defender.

    You can check this link for more information on turn Windows Defender on or off: http://windows.microsoft.com/en-US/windows-vista/Turn-Windows-Defender-on-or-off

    Note: Make sure that you enable the antivirus once you are finished with the test. If the problem is resolved, you may need to contact the manufacturer of the program for the settings that can be changed or if there are other updates for this program.

    Method 2:

    Follow the steps in troubleshooting this article and check if that helps:

    How to troubleshoot Windows Defender definition update

    http://support.Microsoft.com/kb/918355

    Also, try the steps in this article: Impossible to activate the application Windows Defender in Windows Vista

    Method 3:

    Try to restart the Windows Defender service and check if it helps.

    a. Click Start on the start menu, search type services.msc and press ENTER.

    b. in the services window, locate Windows Defender service in the services list.

    c. check that the status is started. If the condition column is blank, right-click on the service and select start.

    d. If you get error trying to force start the Windows Defender service, try to change the Startup Type to automatic and restart the computer.

  • Stupid old backpacker (me) cannot understand why this query returns 1 row

    Hi all

    In reference to {: identifier of the thread = 2456973}, why do
    select sum(count(decode(job, 'CLERK', 1, null))) CLERKS
    , sum(count(decode(job, 'SALESMAN', 1, null))) SALESMANS
    from emp group by job;
    only 1 rank and not 1 for each task? In fact, I had to test it myself to believe.

    It returns the data as if the query were
    select sum(CLERKS), sum(SALESMANS)
    from (select count(decode(job, 'CLERK', 1, null)) CLERKS, count(decode(job, 'SALESMAN', 1, null)) SALESMANS
             from emp group by job)
    Using only a single aggregate (count or sum) returns 1 row per job, as expected

    John Stegeman wrote:
    It returns the data as if the query were

    select sum(CLERKS), sum(SALESMANS)
    from (select count(decode(job, 'CLERK', 1, null)) CLERKS, count(decode(job, 'SALESMAN', 1, null)) SALESMANS
    from emp group by job)
    

    Exactly the point ;-)

    It seems that Oracle actually do, a group of 'double' in the same operation.
    Attend plans to explain in this example:

    SQL> select count(decode(job, 'CLERK', 1, null)) CLERKS
      2       , count(decode(job, 'SALESMAN', 1, null)) SALESMANS
      3  from scott.emp group by job;
    
        CLERKS  SALESMANS
    ---------- ----------
             0          0
             0          0
             0          0
             0          4
             4          0
    
    Execution Plan
    ----------------------------------------------------------
    Plan hash value: 1697595674
    
    ---------------------------------------------------------------------------
    | Id  | Operation          | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    ---------------------------------------------------------------------------
    |   0 | SELECT STATEMENT   |      |     5 |    40 |     4  (25)| 00:00:01 |
    |   1 |  HASH GROUP BY     |      |     5 |    40 |     4  (25)| 00:00:01 |
    |   2 |   TABLE ACCESS FULL| EMP  |    14 |   112 |     3   (0)| 00:00:01 |
    ---------------------------------------------------------------------------
    

    And compare it to the one with the double aggregates:

    SQL> select sum(count(decode(job, 'CLERK', 1, null))) CLERKS
      2       , sum(count(decode(job, 'SALESMAN', 1, null))) SALESMANS
      3  from scott.emp group by job;
    
        CLERKS  SALESMANS
    ---------- ----------
             4          4
    
    Execution Plan
    ----------------------------------------------------------
    Plan hash value: 417468012
    
    ----------------------------------------------------------------------------
    | Id  | Operation           | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    ----------------------------------------------------------------------------
    |   0 | SELECT STATEMENT    |      |     1 |     8 |     4  (25)| 00:00:01 |
    |   1 |  SORT AGGREGATE     |      |     1 |     8 |     4  (25)| 00:00:01 |
    |   2 |   HASH GROUP BY     |      |     1 |     8 |     4  (25)| 00:00:01 |
    |   3 |    TABLE ACCESS FULL| EMP  |    14 |   112 |     3   (0)| 00:00:01 |
    ----------------------------------------------------------------------------
    

    There are GROUP BY hash and SORT GLOBAL times.

    It is really unnecessary to an aggregate on an aggregate - if two aggregates are used "in the same group level.
    Sum() aggregates are used on an already aggregated value, so it doesn't look like Oracle which actually cures like 'first do the internal aggregate using the group specified by and then do the external aggregation on the result with any group.'

    Look at this example where I combine aggregates "double" with "single" aggregates:

    SQL> select sum(count(decode(job, 'CLERK', 1, null))) CLERKS
      2       , sum(count(decode(job, 'SALESMAN', 1, null))) SALESMANS
      3       , count(decode(job, 'SALESMAN', 1, null)) SALESMANS2
      4       , count(*) COUNTS
      5  from scott.emp group by job;
    
        CLERKS  SALESMANS SALESMANS2     COUNTS
    ---------- ---------- ---------- ----------
             4          4          1          5
    
    Execution Plan
    ----------------------------------------------------------
    Plan hash value: 417468012
    
    ----------------------------------------------------------------------------
    | Id  | Operation           | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    ----------------------------------------------------------------------------
    |   0 | SELECT STATEMENT    |      |     1 |     8 |     4  (25)| 00:00:01 |
    |   1 |  SORT AGGREGATE     |      |     1 |     8 |     4  (25)| 00:00:01 |
    |   2 |   HASH GROUP BY     |      |     1 |     8 |     4  (25)| 00:00:01 |
    |   3 |    TABLE ACCESS FULL| EMP  |    14 |   112 |     3   (0)| 00:00:01 |
    ----------------------------------------------------------------------------
    

    When you mix "doubles" and "single" aggregates, Oracle decides that unique aggregates belong to the 'outer' aggregation
    SALESMAN2 did a count on the aggregated work column which is the result of the 'internal' group by - so only 1.
    The count (*) is also the result of the aggregation of the 'internal '.

    I don't know if it's documented or if it is an 'effect' of internal code used for GROUPING SETS or the internal code used to enable the analytical functions like this:

    SQL> select count(decode(job, 'CLERK', 1, null)) CLERKS
      2       , count(decode(job, 'SALESMAN', 1, null)) SALESMANS
      3       , sum(count(decode(job, 'CLERK', 1, null))) over () CLERKS2
      4       , sum(count(decode(job, 'SALESMAN', 1, null))) over () SALESMANS2
      5  from scott.emp group by job;
    
        CLERKS  SALESMANS    CLERKS2 SALESMANS2
    ---------- ---------- ---------- ----------
             0          0          4          4
             4          0          4          4
             0          0          4          4
             0          0          4          4
             0          4          4          4
    
    Execution Plan
    ----------------------------------------------------------
    Plan hash value: 4115955660
    
    ----------------------------------------------------------------------------
    | Id  | Operation           | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    ----------------------------------------------------------------------------
    |   0 | SELECT STATEMENT    |      |     5 |    40 |     4  (25)| 00:00:01 |
    |   1 |  WINDOW BUFFER      |      |     5 |    40 |     4  (25)| 00:00:01 |
    |   2 |   SORT GROUP BY     |      |     5 |    40 |     4  (25)| 00:00:01 |
    |   3 |    TABLE ACCESS FULL| EMP  |    14 |   112 |     3   (0)| 00:00:01 |
    ----------------------------------------------------------------------------
    

    Personally, I think that I would have preferred if Oracle has raised an error on this "double aggregation" and therefore require me to write this way (if it's the result I wanted):

    select sum(CLERKS), sum(SALESMANS)
    from (select count(decode(job, 'CLERK', 1, null)) CLERKS, count(decode(job, 'SALESMAN', 1, null)) SALESMANS
             from emp group by job)
    

    I don't really see a good use case for aggregations of 'double'-, but rather that he could give you undetected bugs in your code, if you happen to do double aggregation without noticing.

    Interesting thing to know ;-)

  • Help with the query to return the last possible value

    Can someone please help me to create a query for the situation below?

    Table: TABLEA
    Columns:
    FACID VARCHAR2 (10),
    DEPTID VARCHAR2 (10),
    CHARGENUMBER NUMBER (10)

    I have the following data:

    A, B, 1
    A, B, 2
    C, D, 3
    C, D, 4

    I will return the following:

    A, B, 2
    C, D, 4

    In other words, I would return the last possible CHARGENUMBER for FACID and DEPTID.
    The table has no index, and it is responsible for a worksheet in that order.

    Thank you very much!

    Hello

    If you have a TIMESTAMP column, called entry_dt, you can use a Top - N query like this to find the last x entries.

    WITH  got_rnum  AS
    (
         SELECT  my_table.*
         ,     RANK () OVER (ORDER BY entry_dt DESC)     AS rnum
         FROM     my_table
    )
    SELECT     *     -- or list all columns except rnum
    FROM     got_rnum
    WHERE     rnum     <= x
    ;
    

    It is very common to have a trigger to ensure that columns like entry_dt are met.

    If you have only one statement that inserts with hundreds of lines, they can all have the same entry_dt. (The value of SYSTIMESTAMP is constant throughout a statement, even if it takes a few seconds).
    The above query uses RANK, so if you tell him you want the last 10 entries, it can return more than 10, because it includes all lines with exactly the same entry_dt as the 10th. If you want to exactly 10 rows returned, even if there is a tie for 10th place, then use ROW_NUMBER instead of RANK; the rest of the query is the same.

  • SQL QUERY THAT RETURNS THE PL/SQL

    Hello

    I'm putting in 4.2 below apex

    DECLARE

    date of frdate: =: P22_FROMDATE;

    date date: =: P22_TODATE;

    l_date1 varchar2 (11): = to_char(frdate,'dd-mon-yyyy');

    l_date2 varchar2 (11): = to_char(todate,'dd-mon-yyyy');

    v_sql varchar2 (32000);

    v_Name varchar2 (4000): = months_name (frdate, todate);

    char (1) of the v1: = q "[']";

    number of lbr1 (6): =: P22_FROMBRANCH;

    number of LBR2 (6): =: P22_TOBRANCH;

    number of M1 (6): = 11;

    Start

    v_sql: ='SELECT * FROM (SELECT LBRCODE, PRDACCTID, MN, AVGX FROM (SELECT LBRCODE, PRDACCTID, MN, SUM (BALL) BALL, COUNT (MN) DAYS, ROUND (SUM (BAL) count (MN), 2) AVGX ';))

    v_sql: = v_sql | "FROM (SELECT LBRCODE, PRDACCTID, TO_CHAR (BALDATE,'|)) CHR (39) | ' MM' | CHR (39) |') ' | ' ||'|| CHR (39) | » _'|| CHR (39) |' | ' || «TO_CHAR (BALDATE,'|)» CHR (39) | ' AAAA '. CHR (39) |') MN, BALL ';

    V_SQL: = V_SQL | "(SELECT Q2. LBRCODE, Q2. PRDACCTID, T1. BALDATE, T_OST_NEW (Q2. LBRCODE, Q2. PRDACCTID, T1. BALDATE) BALL ';

    V_SQL: = V_SQL | "FROM (select TO_DATE('||) Chr (39) | l_date1 | Chr (39) | «, » || CHR (39) | ' DD-MON-YYYY ' | CHR (39) |') baldate FROM DUAL Union all the ';

    V_SQL: = V_SQL |' select (TO_DATE('||) Chr (39) | l_date1 | Chr (39) | «, » || CHR (39) | ' DD-MON-YYYY ' | CHR (39) |') + level) double baldate ';

    V_SQL: = V_SQL |' connect by level < = (TO_DATE('||) Chr (39) | l_date2 | Chr (39) | «, » || CHR (39) | ' DD-MON-YYYY ' | CHR (39) |') -TO_DATE('||) Chr (39) | l_date1 | Chr (39) | «, » || CHR (39) | ' Dd-mon-yyyy ' | CHR (39) |')) ) Q1,';

    V_SQL: = V_SQL | "(SELECT LBRCODE,'|) ' (rpad (prdcd, 8,'|)) V1 ||'' || v1 |') || LTRIM (rpad('|| v1 ||) » x'|| V1 | «, 25, » || v1 | » 0' || v1||'),'|| v1 | » x'|| v1 |')) prdacctid OF D009021 WHERE the LBRCODE between ' | : P22_FROMBRANCH |' and ' | : P22_TOBRANCH | "AND moduleinfo =' | TO_NUMBER(:P22_SELECTLIST);

    V_SQL: = V_SQL |') ((Q2)) GROUP BY LBRCODE, PRDACCTID, MN))';

    V_SQL: = V_SQL | "PIVOT (MAX (AVGX) (MN) IN (';))

    V_SQL: = V_SQL | V_NAME;

    V_SQL: = V_SQL |')) ORDER OF LBRCODE, PRDACCTID ';

    RETURN V_SQL;

    END;

    I created all the elements of the required page

    I get the error message like missing expression

    to test, I created a function to return the query, it works very well know to return a query that gives me desired report

    am I missing something?

    Help, please

    HEMU wrote:

    Hello Sir

    Sorry to bother you again

    I tried to use «function that returns colon-delimited topics»

    and I got following error

    unable to determine query headings: ORA-06550: line 1, column 138: PLS-00103: Encountered the symbol ";" when expecting one of the following:  . ( ) , * % & = - + < / > at in is mod remainder not rem =>  <> or != or ~= >= <= <> and or like like2 like4 likec between || multiset member submultiset The symbol ")" was substituted for ";" to continue.
    
    failed to parse SQL query:
    

    can take you a look at page901 once again please and a function named months_namex

    is it feasible that I'm looking for?

    The immediate cause of this error is simply incorrect report headings function call syntax:

    return months_namex(to_date(:p901_fromdate,'dd-mon-yyyy'),to_date(:p901_todate,'dd-mon-yyyy')

    This should be:

    return months_namex(to_date(:p901_fromdate,'dd-mon-yyyy'),to_date(:p901_todate,'dd-mon-yyyy'));

    However there is no months_namex function defined in the workspace.

  • Query Union returns the correct data x 2

    I have a union query that returns 2 identical lists of data. The data are correct, but I can't work on why it is duplicated. Can anyone help? Thank you.

    John
    ****************************
    set linesize 400
    set pagesize 9999
    NewPage Set 1
    wrap off Set
    break off Set
    Set of feedback on

    set the file name = CATS_TURBO_all_LiveT

    coil & filename

    Noprint today new_value DATEVAR COLUMN
    COLUMN case_id FORM 999999 TITLE 'fault '.
    COLUMN product_name FORMAT a10 HEADING 'node '.
    COLUMN priority_type_name format a4 POSITION "PRI."
    Report_date FORMAT of the COLUMN entitled date 'Date of Recvd'
    Restore_date FORMAT of the COLUMN date TOPIC "restored".
    Close_date FORMAT of the COLUMN date POSITION "closed".
    COLUMN assigned_tech_id FORMAT a10 TITLE "GENIUS".
    COLUMN status_type_name FORMAT a3 DIRECTION "FS".
    Header of COLUMN name format a4 'Type '.
    Header of COLUMN Champ_1 format a20 'Exchange '.
    COLUMN sla_name format a12 direction "platform".
    Format COLUMN header generic a4 "Gen."
    COLUMN question_text format a90 titled "Error Description".
    COLUMN note_text a90 format called 'progress '.

    TTITLE left 'report ' -.
    Center ' TURBO all flaws (& filename... SQL) "-"
    Jump STRAIGHT DATEVAR-
    Left ' wait > > ' jump 1

    Select distinct
    a.case_id "Fault."
    c.product_name
    , decode (f.priority_type_name, 'Low', '4', 'Medium', '3', 'High', '2', 'Urgent', '1') Pri
    , to_char (a.report_date, ' DD/MM/YYYY HH24') "received".
    , to_char (' a.restore_date, ' DD/MM/YYYY HH24 ")"restored ".
    , to_char (a.close_date, ' DD/MM/YYYY HH24') 'closed '.
    , decode (d.name, 'Software', from ", 'Hardware', 'H', 'Firmware', 'F', 'Unknown', 'U', 'General', 'Gen', 'Doc', 'Doc', 'n' and"No. Fault"") 'Type '.
    , decode (b.status_type_name, ' closed - resolved ', '02', 'Pending', '40', 'On Hold - waiting for approval', '41 ', 'pending', '41', 'Wait-Service restored', ' 41', 'lack of training', '44', 'Telesys survey fault', '44') FS
    g.field_1
    e.sla_name
    , decode (a.assigned_tech_id, '10', 'JSMITH', '09', 'MBROWN', '07', 'SCHATTER', '08', 'RSMEED' ', '12', ' SCHOYM') 'B '.
    , to_char (sysdate, 'DD-MON-YYYY HH24') today
    , to_char (translate (dbms_lob.substr(a.question_text,100), CHR (13) |)) CHR (10), CHR)
    question_text 32)))
    , null "Note".
    of oracledb.incident one
    oracledb.status_type b
    c oracledb.item_type
    oracledb.problem_type d
    e oracledb.sla
    oracledb.priority_type f
    oracledb.item g
    oracledb.incident_note h
    where (a.status_type_id = b.status_type_id)
    and (a.product_id = c.product_id)
    and (a.problem_type_id = d.problem_type_id)
    and (a.sla_id = e.sla_id)
    and (a.priority_type_id = f.priority_type_id)
    and (a.product_id = g.product_id)
    and e.sla_name = "TURBO PÉI"
    and g.field_1 not in the (' SysCntl-1', ' SysCntl-2', "TURBO PÉI" "")
    and a.case_id = h.case_id (+)
    and not exists (select case_id from k oracledb.incident_note where k.case_id = a.case_id)
    and a.deleted <>' 1'
    Union
    Select distinct
    a.case_id "Fault."
    c.product_name
    , decode (f.priority_type_name, 'Low', '4', 'Medium', '3', 'High', '2', 'Urgent', '1') Pri
    , to_char (a.report_date, ' DD/MM/YYYY HH24') "received".
    , to_char (' a.restore_date, ' DD/MM/YYYY HH24 ")"restored ".
    , to_char (a.close_date, ' DD/MM/YYYY HH24') 'closed '.
    , decode (d.name, 'Software', from ", 'Hardware', 'H', 'Firmware', 'F', 'Unknown', 'U', 'General', 'Gen', 'Doc', 'Doc', 'n' and"No. Fault"") 'Type '.
    , decode (b.status_type_name, ' closed - resolved ', '02', 'Pending', '40', 'On Hold - waiting for approval', '41 ', 'pending', '41', 'Wait-Service restored', ' 41', 'lack of training', '44', 'Telesys survey fault', '44') FS
    g.field_1
    e.sla_name
    , decode (a.assigned_tech_id, '10', 'JSMITH', '09', 'MBROWN', '07', 'SCHATTER', '08', 'RSMEED' ', '12', ' SCHOYM') 'B '.
    , to_char (sysdate, 'DD-MON-YYYY HH24') today
    , to_char (translate (dbms_lob.substr(a.question_text,100), CHR (13) |)) Chr (10), Chr (32))) question_text
    , to_char (translate (dbms_lob.substr(h.note_text,100), CHR (13) |)) Chr (10), Chr (32))) note_text
    of oracledb.incident one
    oracledb.status_type b
    c oracledb.item_type
    oracledb.problem_type d
    e oracledb.sla
    oracledb.priority_type f
    oracledb.item g
    oracledb.incident_note h
    where (a.status_type_id = b.status_type_id)
    and (a.product_id = c.product_id)
    and (a.problem_type_id = d.problem_type_id)
    and (a.sla_id = e.sla_id)
    and (a.priority_type_id = f.priority_type_id)
    and (a.product_id = g.product_id)
    and e.sla_name = "TURBO PÉI"
    and g.field_1 not in the (' SysCntl-1', ' SysCntl-2', "TURBO PÉI" "")
    and a.case_id = h.case_id
    and h.note_id = (select max (i.note_id)
    oracledb.incident_note I have
    where a.case_id = i.case_id)
    and a.deleted <>' 1'
    order by 1;
    /
    SPOOL OFF
    Clear jump
    output

    Published by: user13388553 on 11/24/2010 14:59

    If your code is that you run in the production data splits because you're runnign queries twice.

    from oracledb.incident_note i
    where a.case_id = i.case_id)
    and a.deleted '1'
    order by 1;
    /
    SPOOL OFF
    

    The semicolon after that command by 1 causes the statement to be executed, the slash on the next line causes the reexecute being. Delete one of them.

    John

  • Help with the query to return the results of the group in the table?

    Hello
    Im a total noob, so please be nice...!

    I'm looking around a table contains a column of WORD and a WORD_TYPE_ID column.
    Words can have the same type_id.

    What I'm trying to do is to write a query that will return the longest word for each word_type_id.
    I tried for hours to get it and everything seems to get is two error messages or just the longest word in the whole WORD column.

    Is the furthest I can get before things break down...

    Select Word
    table
    where
    Length (Word) =
    (
    Select
    Max (length (Word))
    table
    )

    Any help on this or if I could be pointed in the right direction it would be greatly appreciated.

    Thank you

    Hello

    Welcome to the forum!

    Here's one way:

    SELECT    word_type_id
    ,       MIN (word) KEEP (DENSE_RANK LAST ORDDER BY LENGTH (word))     AS longest_word
    FROM       table_x
    GROUP BY  word_type_id;
    

    If there be a tie in some word_type_id (i.e. 2 or more words have exactly the same length, which is the longest in this group) the expression above will return the first one alphabetically. (This is what means here MIN.)

    Published by: Frank Kulash, 11 August 2009 13:56

    You almost had it.
    As you have noticed, you get the longest line across the table. This is because your subquery was watching the entire table.
    If you to correlate the subquery to the row in the main table, as shown below, you can get the longest word in each group:

    select  word
    from     table     m                              -- m for main
    where      length (word) = (
                                select  max (length(word))
                   from     table
                   where     word_type_id  = m.word_type_id     -- New
                   );
    
  • Why this disable structure encapsulating the loop for that I'm falling?

    In the middle of coding and debugging I noticed something weird... now I'm just curious.

    Here is what happened (audio WARNING may be a bit much, fans of pumping in a warehouse im in...):

    https://www.YouTube.com/watch?v=vC9BKJ0CwmY

    I'm really just curious to know why this is happening - it seems that there is the note of "make sure wire you the error" fault behind the loop that the disable struc overlapped a bit...

    Why the struc disable that first, I dropped in this video did seize all of the loop?

    -pat

    You have this decoration of the label on your block diagram behind your loop For. When you put the new business structure, he captured this label which is outside the loop For. This forces the case structure to take the loop too, since it is the only way to recover the property node and label.

  • don't get open email addresses do not message, then possibly the email opens; Why this took place over the 2 or 3 days?

    During 2-3 days when I try to open an e-mail or delete an email I get "not responding" after 30 seconds or so him "unresponsive" goes then and I can open the e-mail or delete it. Why this is happening now and how can I fix it? It is very annoying to have to wait to read or delete an e-mail. I compact the file whenever the message appears on my screen.

    https://wiki.Mozilla.org/Thunderbird: test: Antivirus_Related_Performance_Issues #McAfee

  • Why this two queries are not same

    Hi all

    Can you please explain this fundamental thing. Why this two queries are different. (10.2.0.3 Solaris Sparc 64)
    create table x1(a1 varchar2(10),a2 number, a3 varchar2(10));
    create table x2(b1 varchar2(10),b2 number, b3 varchar2(10));
    insert into x1 values('X101',1,'XX1');
    insert into x1 values('X101',1,'XX1');
    insert into x1 values('X102',1,'XX2');
    insert into x1 values('X103',2,'XX3');
    insert into x1 values('X104',2,'XX4');
    insert into x1 values('X105',3,'XX5');
    commit;
    
    insert into x2 values('X101',1,'X21');
    insert into x2 values('X101',1,'X21');
    insert into x2 values('X102',1,'X22');
    insert into x2 values('X103',2,'X23');
    insert into x2 values('X104',2,'X24');
    commit;
    
    WITH xx AS (select b1,b2 from x2 where b1 IS NULL)
     select x1.* from x1 ,  xx
      where x1.a1 = xx.b1(+) and  x1.a2 = xx.b2(+) ;
     
    A1                 A2 A3
    ---------- ---------- ----------
    X105                3 XX5
    X104                2 XX4
    X102                1 XX2
    X103                2 XX3
    X101                1 XX1
    X101                1 XX1
     
    6 rows selected
     
    select x1.* from x1, x2 where x1.a1 = x2.b1(+)
        and x1.a2 = x2.b2(+)  and x2.b1 IS NULL;
     
    A1                 A2 A3
    ---------- ---------- ----------
    X105                3 XX5
     
    select b1,b2 from x2 where b1 IS NULL;
     
    B1                 B2
    ---------- ----------
     

    Thank you!
    NA not (sentence of) think of this.
    + (it's one of those things that I really need of don't forget do not forget ;)) +)

    hoek&XE> select x1.*
      2  from   x1
      3  where not exists ( select null
      4                     from   x2
      5                     where  x1.a1 = x2.b1
      6                     and    x1.a2 = x2.b2
      7                    );
    
    A1                 A2 A3
    ---------- ---------- ----------
    X105                3 XX5
    
    1 rij is geselecteerd.
    
    Uitvoeringspan
    ----------------------------------------------------------
    Plan hash value: 816925353
    
    ---------------------------------------------------------------------------
    | Id  | Operation          | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    ---------------------------------------------------------------------------
    |   0 | SELECT STATEMENT   |      |     5 |   100 |     5  (20)| 00:00:01 |
    |*  1 |  HASH JOIN ANTI    |      |     5 |   100 |     5  (20)| 00:00:01 |
    |   2 |   TABLE ACCESS FULL| X1   |     6 |    72 |     2   (0)| 00:00:01 |
    |   3 |   TABLE ACCESS FULL| X2   |     5 |    40 |     2   (0)| 00:00:01 |
    ---------------------------------------------------------------------------
    
    Predicate Information (identified by operation id):
    ---------------------------------------------------
    
       1 - access("X1"."A1"="X2"."B1" AND "X1"."A2"="X2"."B2")
    
    Statistics
    ----------------------------------------------------------
              1  recursive calls
              0  db block gets
              6  consistent gets
              0  physical reads
              0  redo size
            518  bytes sent via SQL*Net to client
            384  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
              1  rows processed
    
  • Returns the time value zero calendar

    Hi, I write code with calendar that return the value zero for HOUR_OF_DAY and MINUTE when I run this code in Strom2(9550-5.0.0.334) below.

    Calendar calendar = Calendar.GetInstance ();
    Date date = new Date (this.arrivalTimeField.getDate ());
    calendar.setTime (date);
    Day int = calendar.get (Calendar.HOUR_OF_DAY);
    int minute = calendar.get (Calendar.MINUTE);

    So please help me for this problem and thanks in advanced

    I had a lot of problems like myself.  Invariably, I find that the bug is my code.  Usually, it is not difficult to find using the appropriate debug or SimpleDateFormat (because times are difficult to interpret, it is good to let the system do it for you!).  I suggest you do the same thing here.

    If you find that the system does not have it that you wait, then give us the details, for example, give us the long value that you provide to the calendar and the time you go out. You should be able to do it in two or three lines, just using the standard Java RIM (i.e. None of your classes).  You can also indicate the time zone that you are testing in.

Maybe you are looking for