[Help] Need help with php, Sql variables

I have a users table contain fiedls "old, new and total."

When file, update user DEFINED total is $total


where $total = old + $nouveau

I did it, I used echo to make sure it's ok, but it's not:

/ * Variable total Count * /.
$old = ['old'] $row_rs_users;
$new = $row_rs_users ['new'];
$total = $vieux + $new;
echo $total;
If ((isset($_POST["MM_update"])) & & ($_POST ["MM_update"] == "doit_form")) {}
$updateSQL = sprintf ("UPDATE users SET total = WHERE id = %s %s",)
$total,
GetSQLValueString ($_POST ['id'], "int"));

Thank you

As a part of your code, it is impossible to debug.

However, your approach is bad anyway. All you need to do is add the new value to the old in the SQL query.

$updateSQL = sprintf("UPDATE users SET total=(total+%s) WHERE id=%s",
                       GetSQLValueString($_POST['fieldName'], "double"),
                       GetSQLValueString($_POST['id'], "int"));

$_POST ['fieldName'] is the new value. Use the 'double' if the value contains a decimal point. If it is an integer, replace 'double' 'int '.

Tags: Dreamweaver

Similar Questions

  • Need help with a SQL query

    Hello

    I have a data in table (raj_table) with columns (char11) raj_id, raj_number (varchar2 (15)), raj_format (NUMBER), Primary_ID (identity with the values of the primary key column)

    Primary_ID raj_id Raj_number Raj_format

    1                            raj                 rajvend                      1

    2                            raj                 rajvend                      1

    3                            raj                 rajvendor1                 2

    4                            raj                 rajvendor1                 2

    5                            raj                 rajvendor1                 2

    6                            raj                 rajvendor2                 3

    I used under SQL to get query output as below, but has not achieved the required result:

    Select client_id vendor_number, vendor_format, primary_id, row_number() on sl_no (client_id partition, primary_id, vendor_format order of client_id primary_id, vendor_format, vendor_number, vendor_number)

    from raj_table by sl_no asc

    SL_NO raj_id raj_number raj_format primary_id

    1                   1                   raj              rajvendor                 1

    1                   2                  raj              rajvendor                 1

    2                   3                   raj              rajvendor1                2

    2                   4                   raj              rajvendor1                2

    2                   5                  raj               rajvendor1                2

    3                   6                    raj              rajvendor2                3

    I need help with a SQL query to get the result as above without using the group by clause. I want to bring together the combination of separate line of the three columns (raj_id, raj_number, raj_format) and add a unique serial number for each online game (SL_NO column below). So, above there are 3 unique set of (raj_id, raj_number, raj_format) I can get in a group by clause, but I can not add prmiary_id, SL_NO values if I group by clause. I used the analytical functions like row_number() but no luck. Need solution for this.

    with t as)

    Select 'raj' raj_id, 'rajvend' raj_number, 1 raj_format, 1 primary_id Union double all the

    Select option 2, 'raj', 'rajvend', 1 double Union all

    Select 3, 'raj', 'rajvendor1', 2 double Union all

    Select 4, 'raj', 'rajvendor1', 2 double Union all

    Select 5, 'raj', 'rajvendor1', 2 double Union all

    Select 6, 'raj', 'rajvendor2', 3 double

    )

    Select dense_rank() over (order of raj_id, raj_number, raj_format) sl_no,

    t.*

    t

    order by primary_id

    /

    PRIMARY_ID RAJ RAJ_NUMBER RAJ_FORMAT SL_NO
    ---------- ---------- --- ---------- ----------
    1 1 raj rajvend 1
    1 2 raj rajvend 1
    2 3 raj rajvendor1 2
    2 4 raj rajvendor1 2
    2 5 raj rajvendor1 2
    3 6 raj rajvendor2 3

    6 selected lines.

    SQL >

    SY.

  • Need help with query SQL Inline views + Group

    Hello gurus,

    I would really appreciate your time and effort on this application. I have the following data set.

    Reference_No---Check_Number---Check_Date---description---Invoice_Number---Invoice_Type---Paid_Amount---Vendor_Number
    1234567 11223 - 05/07/2008 -paid for cleaning- 44345563-I-* 20.00 *---19
    1234567 11223 - 05/07/2008 - 44345563 -a--10,00---19 ofbad quality adjustment
    7654321 11223 - 05/07/2008 - setting the last billing cycle - 23543556 - A - 50.00 - 19
    4653456 11223 - 05/07/2008 - paid for cleaning - 35654765 - I - 30, 00-19

    Please ignore '-' added for clarity

    I'm writing a paid_amount based on Reference_No, Check_Number, Payment_Date, Invoice_Number, aggregate query Invoice_Type, Vendor_Number and display description with Invoice_type 'I' when there are multiple records with the same Reference_No, Check_Number, Payment_Date, Invoice_Type, Invoice_Number, Vendor_Number. When there are no more records I want to display the respective Description.

    The query should return the following data set

    Reference_No---Check_Number---Check_Date---description---Invoice_Number---Invoice_Type---Paid_Amount---Vendor_Number
    1234567 11223 - 05/07/2008 -paid for cleaning- 44345563-I-* 10.00 *---19
    7654321 11223 - 05/07/2008 - setting the last billing cycle - 23543556 - A - 50.00 - 19
    4653456 11223 - 05/07/2008 - paid for cleaning - 35654765 - I - 30, 00-19
    Here's my query. I'm a little lost.

    Select b., A.sequence_id, A.check_date, A.check_number, A.invoice_number, A.amount, A.vendor_number
    de)
    Select sequence_id, check_number, check_date, invoice_number, sum (paid_amount) sum, vendor_number
    of the INVOICE
    Sequence_id group check_date, check_number, invoice_number, vendor_number
    ) A, B OF INVOICE
    where A.sequence_id = B.sequence_id


    Thank you
    Nick

    It seems that this is a duplicate thread - correct me if I am wrong in this case->

    Need help with query SQL Inline views + Group

    Kind regards.

    LOULOU.

  • Help with making SQL query references to column aliases in the Case statement

    I need help with a sql query that I'm trying. I can go about it the wrong way, but I would be grateful if I could get any suggestions on possible solutions. This is my query:


    SELECT DISTINCT spriden_pidm, spriden_id id, spriden_last_name | ',' | spriden_first_name name,

    CASE
    WHEN rcresar_comm_code_01 IN ('268 ', '269', ' 270') THEN rcresar_comm_code_01
    WHEN rcresar_comm_code_02 IN ('268 ', '269', ' 270') THEN rcresar_comm_code_02
    WHEN rcresar_comm_code_03 IN ('268 ', '269', ' 270') THEN rcresar_comm_code_03
    WHEN rcresar_comm_code_04 IN ('268 ', '269', ' 270') THEN rcresar_comm_code_04
    WHEN rcresar_comm_code_05 IN ('268 ', '269', ' 270') THEN rcresar_comm_code_05
    WHEN rcresar_comm_code_06 IN ('268 ', '269', ' 270') THEN rcresar_comm_code_06
    WHEN rcresar_comm_code_07 IN ('268 ', '269', ' 270') THEN rcresar_comm_code_07
    WHEN rcresar_comm_code_08 IN ('268 ', '269', ' 270') THEN rcresar_comm_code_08
    WHEN rcresar_comm_code_09 IN ('268 ', '269', ' 270') THEN rcresar_comm_code_09
    WHEN rcresar_comm_code_10 IN ('268 ', '269', ' 270') THEN rcresar_comm_code_10
    END acg_elig_comm_code

    CASE
    WHEN acg_elig_comm_code = ' 268' THEN 'rigorous HS course. "
    WHEN acg_elig_comm_code = '269' THEN ' 2 or several AP or IB"
    WHEN acg_elig_comm_code = '270' THEN 'NOC as possible ".
    END comm_code_description

    OF spriden, rcresar, rcrapp1

    WHERE (rcresar_comm_code_01 IN ('268 ', '269', ' 270')

    OR rcresar_comm_code_02 ('268 ', '269', ' 270')

    OR rcresar_comm_code_03 ('268 ', '269', ' 270')

    OR rcresar_comm_code_04 ('268 ', '269', ' 270')

    OR rcresar_comm_code_05 ('268 ', '269', ' 270')

    OR rcresar_comm_code_06 ('268 ', '269', ' 270')

    OR rcresar_comm_code_07 ('268 ', '269', ' 270')

    OR rcresar_comm_code_08 ('268 ', '269', ' 270')

    OR rcresar_comm_code_09 ('268 ', '269', ' 270')

    OR rcresar_comm_code_10 ('268 ', '269', ' 270'))


    Rcresar_aidy_code = & aidy_code

    AND rcrapp1_aidy_code = rcresar_aidy_code

    AND rcrapp1_curr_rec_ind = 'Y '.

    AND rcrapp1_seq_no = rcresar_seq_no


    AND spriden_pidm = rcresar_pidm

    AND rcrapp1_pidm = rcresar_pidm


    AND spriden_change_ind IS NULL

    ORDER BY name


    The second case statement is where I don't know exactly what it takes to get what I want.

    Output should be like:
    spriden_pidm name ID acg_elig_comm_code comm_code_description
    «0000000000', ' 1111111111 ","John Doe","268", «rigorous HS race"»

    If I take the second case statement it works great except that I do not have my comm_code description column. My question is how can I use my first statement value box to determine this column? I think that I need a case statement as I have, but I don't know how to reference the value of acg_elig_comm_code. Any help would be greatly appreciated. Thank you.

    Published by: blackhole82 on January 20, 2009 09:20

    Hello

    You cannot use the alias column in the query, even where it is set (except in the ORDER BY clause).
    You can set the alias in a subquery and then use it in a great query, like this:

    WITH  sub_q  AS
    (
        SELECT DISTINCT spriden_pidm,spriden_id id, spriden_last_name||', '||spriden_first_name name,
            CASE
                WHEN rcresar_comm_code_01 IN ('268','269','270') THEN rcresar_comm_code_01
                WHEN rcresar_comm_code_02 IN ('268','269','270') THEN rcresar_comm_code_02
                WHEN rcresar_comm_code_03 IN ('268','269','270') THEN rcresar_comm_code_03
                WHEN rcresar_comm_code_04 IN ('268','269','270') THEN rcresar_comm_code_04
                WHEN rcresar_comm_code_05 IN ('268','269','270') THEN rcresar_comm_code_05
                WHEN rcresar_comm_code_06 IN ('268','269','270') THEN rcresar_comm_code_06
                WHEN rcresar_comm_code_07 IN ('268','269','270') THEN rcresar_comm_code_07
                WHEN rcresar_comm_code_08 IN ('268','269','270') THEN rcresar_comm_code_08
                WHEN rcresar_comm_code_09 IN ('268','269','270') THEN rcresar_comm_code_09
                WHEN rcresar_comm_code_10 IN ('268','269','270') THEN rcresar_comm_code_10
            END acg_elig_comm_code   -- Originally posted with , here (error)
        FROM spriden, rcresar, rcrapp1
        WHERE (rcresar_comm_code_01 IN ('268','269','270')
                OR rcresar_comm_code_02 IN ('268','269','270')
                OR rcresar_comm_code_03 IN ('268','269','270')
                OR rcresar_comm_code_04 IN ('268','269','270')
                OR rcresar_comm_code_05 IN ('268','269','270')
                OR rcresar_comm_code_06 IN ('268','269','270')
                OR rcresar_comm_code_07 IN ('268','269','270')
                OR rcresar_comm_code_08 IN ('268','269','270')
                OR rcresar_comm_code_09 IN ('268','269','270')
                OR rcresar_comm_code_10 IN ('268','269','270'))
        AND rcresar_aidy_code = &aidy_code
        AND rcrapp1_aidy_code = rcresar_aidy_code
        AND rcrapp1_curr_rec_ind = 'Y'
        AND rcrapp1_seq_no = rcresar_seq_no
        AND spriden_pidm = rcresar_pidm
        AND rcrapp1_pidm = rcresar_pidm
        AND spriden_change_ind IS NULL
    )
    SELECT    sub_q.*,
              CASE
                  WHEN acg_elig_comm_code = '268' THEN 'Rigorous HS course'
                  WHEN acg_elig_comm_code = '269' THEN '2 or more AP or IB'
                  WHEN acg_elig_comm_code = '270' THEN 'ACG possible'
              END comm_code_description
    FROM      sub_q
    ORDER BY  name
    

    Furthermore, you might think to rearrange your table, so that you do not have 10 columns (rcresar_comm_code_01, rcresar_comm_code_02,...) that essentially do the same thing. The usual way to handle this kind of one-to-many relationship is to have all rcresar_comm_codes in a separate table, one per line, with a pointer to the table where you have them now.

    Published by: Frank Kulash, January 20, 2009 11:35
    Syntax error has been corrected

  • Help with the session variable PHP CS5.5 - Please

    Hi all

    I am needing a little help with the help of a session variable, and I hope someone can point me in the right direction.

    I created a PHP page that uses the Dreamweaver 'User authentication' feature and the basics of this works very well, to direct a user to the correct page depending on whether they are or are not a valid user. I want to customize the page 'user valid' with people, user name entered in the authentication of the user table... a seemingly simple task using a session variable, but I just seem not to be able to make it work!

    The generated code for the AU on page 1 is the following:

    <? PHP

    Validate request to connect to this site.

    If (! isset {})

    session_start();

    }

    $loginFormAction = $_SERVER ['PHP_SELF'];

    If (isset($_GET['accesscheck'])) {}

    $_SESSION ['PrevUrl'] = $_GET ['accesscheck"];

    }

    If (isset($_POST['txtfirst_name'])) {}

    $loginUsername = $_POST ['txtfirst_name'];

    $password = $_POST ['txtsurname'];

    $MM_fldUserAuthorization = "";

    $MM_redirectLoginSuccess = "member_update.php";

    $MM_redirectLoginFailed = 'login.php ';

    $MM_redirecttoReferrer = false;

    @mysql_select_db ($database_panto, $panto);

    $LoginRS__query = sprintf ("SELECT firstname, name OF web_access WHERE firstname = %s AND family name = %s",

    GetSQLValueString ($loginUsername, "text"), GetSQLValueString ($password, "text"));

    $LoginRS = mysql_query ($LoginRS__query, $panto) or die (mysql_error ());

    $loginFoundUser = mysql_num_rows ($LoginRS);

    If {($loginFoundUser)

    $loginStrGroup = "";

    If (via PHP_VERSION > = 5.1) {session_regenerate_id (true) ;} else {session_regenerate_id() ;}

    Declare two session variables and assign them

    $_SESSION ['MM_Username'] = $loginUsername;

    $_SESSION ["MM_UserGroup"] = $loginStrGroup;

    If (isset($_SESSION['PrevUrl']) & & false) {}

    $MM_redirectLoginSuccess = $_SESSION ["PrevUrl"];

    }

    Header ("Location:".) $MM_redirectLoginSuccess);

    }

    else {}

    Header ("Location:".) $MM_redirectLoginFailed);

    }

    }

    ? >

    First of all, the text highlighted in red above seems to be setting the session variable that I need. Is this correct?

    If so, what is the code that I need to put on page 2 to use this session variable? or

    I have to do something else on the page 1 to correctly assign the session variable?

    Would be very grateful for your expertise

    Mark

    It seems that you put the columns incorrectly in the user authentication server behavior. This is the SQL query that checks the credentials of the user:

    $LoginRS__query = sprintf ("SELECT firstname, name OF web_access WHERE firstname = %s AND family name = %s",

    GetSQLValueString ($loginUsername, "text"), GetSQLValueString ($password, "text"));

    You are looking for first name and last name, while you should look for the user name and password of the user.

    $_SESSION ['MM_Username"] is a session variable that stores the login name of the user. To use it in a page, all that is needed is the page start with session_start(). You can then echo the value to display.

    If you want to display the person's true name, you must create a recordset in the second page, use of $_SESSION ['MM_Username'] to search for the first name and the patronymic. Alternatively, you can change the code like this (I copied only part of it):

    $LoginRS__query = sprintf ("SELECT firstname, surname OF web_access WHERE firstname = %s AND password is %s",

    GetSQLValueString ($loginUsername, "text"), GetSQLValueString ($password, "text"));

    $LoginRS = mysql_query ($LoginRS__query, $panto) or die (mysql_error ());

    $loginFoundUser = mysql_num_rows ($LoginRS);

    If {($loginFoundUser)

    $loginStrGroup = "";

    $row = mysql_fetch_assoc ($LoginRS);

    $_SESSION ['full_name'] = $row ["FirstName"]. ' ' . $row ['name'];

    If (via PHP_VERSION > = 5.1) {session_regenerate_id (true) ;} else {session_regenerate_id() ;}

    Declare two session variables and assign them

    $_SESSION ['MM_Username"] = $loginUsername;

    $_SESSION ["MM_UserGroup"] = $loginStrGroup;

    You can then use $_SESSION ['full_name'] in a page which begins with session_start().

  • Need help with PL/SQL so and then select

    Hello guys, I am new to the PL/SQl programming (only Java experience) and I'm pretty stuck to my task. It would be great if you could help me. I am in programming with Oracle SQL * Plus Version 10.2.0.3.0

    Whenever a user logs on to the server a database entry is created with information about the logged-on user. I need to create a PL/SQL command that selects all the information from last month. Unfortunately, the date_stamp column has a certain weird format: 1131210 for December 10, 2013


    My idea so far:


    DECLARE

    v_today NUMBER;

    BEGIN

    v_today: = TO_NUMBER (TO_CHAR (SYSDATE, 'MM'));       -Save the number of the month (e.g.12) in v_today

    IF v_today = 01 THEN

    SELECT * from audittrl

    WHERE the date_stamp between 1131201 AND the 1131231;

    ELSIF v_today = 02 THEN

    SELECT * from audittrl

    WHERE the date_stamp between the 1130131 AND 1130101;

    .......

    END IF;

    END;

    /

    Error code: "an INTO clause in this SELECT statement.

    I do not want to save the result to select a variable, hope you can help me. Thanks in advance.

    Hello

    6a4d1bcd-c00e-4dac-AB64-9b6bdb1652d1 wrote:

    Thanks, I'll try that, if still get caught once, I'll be back. Anway I'm not sure of the solution of Chris227, because I can't test it right now. From my point of view it gives you information the current month (e.g., December) and not the month previous (-online November), or have I missed something. ?

    You are right.  In addition, it does not for a given year.  If you have data from several years in the table, it will select lines for the month of December 2012, 2011, 2010,... but also of 2013.

    Here's a way to get around that:

    DECLARE

    prev_month_start PLS_INTEGER: = TO_NUMBER (TO_CHAR (ADD_MONTHS (SYSDATE-1)

    , "YYMM"1' "01"

    )

    );

    this_month_start PLS_INTEGER: = TO_NUMBER (TO_CHAR (SYSDATE

    , "YYMM"1' "01"

    )

    );

    BEGIN
    FOR (IN) rec
    SELECT *.
    Of audittrl
    WHERE the date_stamp > = prev_month_start
    AND date_stamp< >
    ORDER BY user_id, date_stamp - or other

    )
    LOOP
    dbms_output.put_line (rec.date_stamp);
    dbms_output.put_line (rec.event);
    dbms_output.put_line (rec.user_id)
    dbms_output.put_line (rec.host_name);
    END LOOP;
    END;

    This should also be more effective, because it will allow the optimizer to use an index on date_stamp.  Even if there is no index, it will be more effective because it avoids calling any function (for example, SUBSTR) on each line of the table.

    You needn't PL/SQL to get these results.  Just use SQL, you might say:

    SELECT event, host_name, user_id and date_stamp
    Of audittrl
    WHERE the date_stamp > = TO_NUMBER (TO_CHAR (ADD_MONTHS (SYSDATE-1)
    , "YYMM"1' "01"
    )
    )
    AND date_stamp<  to_number="" (="" to_char="" (="" sysdate="" to_number="" (="" to_char="" (="">


    , "YYMM"1' "01"
    )
    )

    ORDER BY user_id, date_stamp - or other

    ;

    Your front end will provide column headers and touch the data so that the columns line up.  It can also set the output to a file.  (For example, if your front-end is SQL * Plus, you can use the command of the COIL.)

    I guess date_stamp is a NUMBER.  If it is a string, the solutions above can be simplified a bit.

    This problem (and many other problems) would be so much simpler if date_stamp was a DATE column.  Using numbers or strings to store the date information is simply asking for trouble.

  • Need help with PL/SQL query complex

    I need help with a query that need access to data from 3 tables. That's what I did

    I created 3 tables

    CREATE TABLE post_table
    (
    post_id varchar (20),
    datepost DATE,
    KEY (post_id) elementary SCHOOL
    ) ;

    CREATE TABLE topic
    (
    TOPIC_ID varchar (20),
    name varchar (20),
    PRIMARY KEY (topic_id)
    );

    CREATE TABLE blogpost_table
    (
    TOPIC_ID varchar (20),
    post_id varchar (20),
    PRIMARY KEY (topic_id, post_id);
    FOREIGN KEY (topic_id) REFERENCES topic (topic_id) ON DELETE CASCADE,
    FOREIGN KEY (post_id) REFERENCES post_table (post_id) ON DELETE CASCADE
    );


    Now, I inserted a few values in these tables as

    INSERT INTO post_table VALUES ('p1', to_date ('2009-09-14 18:00 "," MM/DD/YYYY mi:ss'));))
    INSERT INTO post_table VALUES ('p2', to_date ('2009-07-18 18:00 "," MM/DD/YYYY mi:ss'));))
    INSERT INTO post_table VALUES ('p3', to_date ('2009-07-11 18:00 "," MM/DD/YYYY mi:ss'));))
    INSERT INTO post_table VALUES ('p4', to_date ('2009-03-11 18:00 "," MM/DD/YYYY mi:ss'));))
    INSERT INTO post_table VALUES ('p5', to_date ('2009-07-13 18:00 "," MM/DD/YYYY mi:ss'));))
    INSERT INTO post_table VALUES ('p6', to_date ('2009-06-12 18:00 "," MM/DD/YYYY mi:ss'));))
    INSERT INTO post_table VALUES ('p7', to_date ('2009-07-11 18:00 "," MM/DD/YYYY mi:ss'));))

    INSERT INTO VALUES subject ("t1", "baseball");
    INSERT INTO category VALUES ('t2', 'football');

    INSERT INTO blogpost_table VALUES ("t1", "p1");
    INSERT INTO blogpost_table VALUES ('t1', 'p3');
    INSERT INTO blogpost_table VALUES ("t1", "p4");
    INSERT INTO blogpost_table VALUES ('t1', 'p5');
    INSERT INTO blogpost_table VALUES ('t2', 'p2');
    INSERT INTO blogpost_table VALUES ('t2', 'p6');
    INSERT INTO blogpost_table VALUES ("t2", "p7");


    I'm launching SQL queries on the table in this topic.

    I want to write a SQL query that returns me the name of a topic (s) and the number of blog_post (s) associated with the topic in descending order of the number of blog posts created in July.

    Can someone please help me to write this query?

    Thank you

    Published by: user11994430 on October 9, 2009 07:24

    Thanks for the test of the configuration!

    SQL>SELECT   t.NAME, COUNT(*)
      2      FROM topic t, blogpost_table b, post_table p
      3     WHERE b.topic_id = t.topic_id
      4       AND p.post_id = b.post_id
      5       AND p.datepost >= DATE '2009-07-01'
      6       AND p.datepost < DATE '2009-08-01'
      7  GROUP BY t.NAME
      8  ORDER BY COUNT(*) desc;
    
    NAME                   COUNT(*)
    -------------------- ----------
    baseball                      2
    soccer                        2
    

    HTH, Urs

  • Need help with the procedure variable

    Hi guys,.

    I try to get the list of the TableName of a specific table and store it in a variable and use this variable to LOOP and remove specific data in the table. Here is my code, maybe that will be clearer...

    This procedure within a package

    PROCEDURE DeleteData (parCONTR_NBR IN VARCHAR2)
    AS
    v_TableName CMSR_MAPPING. TABLE_NAME % TYPE;

    BEGIN
    Extract the names of the tables
    SELECT TABLE_NAME
    IN v_TableName
    OF CMSR_MAPPING
    WHERE TABLE_TYPE <>'W '.
    AND ORDER_SEQ <>' 0'
    ORDER BY ORDER_SEQ DESC
    ;

    -Loop on the name of the table
    FOR v_Index in 1... v_TableName.Count LOOP
    -Check that the table name and remove from the respectable table -.
    CASE v_TableName (v_Index)
    WHEN "CMSW_CONTR" THEN
    REMOVE FROM CMSW_CONTR
    WHERE CONTR_NBR = parCONTR_NBR;
    WHEN "CMSW_AMNDS" THEN
    REMOVE FROM CMSW_AMNDS
    WHERE CONTR_NBR = parCONTR_NBR;

    END CASE;

    END LOOP;

    END;

    When I run it, I get the following compile on this line error of TO v_Index IN 1.. v_TableName.COUNT LOOP:
    PLS-00487: Invalid reference to the variable 'V_TABLENAME '.

    Can someone help with this? What I'm doing wrong here?

    Like this?

    /* Formatted on 5/20/2011 12:37:05 PM (QP5 v5.149.1003.31008) */
    CREATE OR REPLACE PROCEDURE DeleteData (parCONTR_NBR IN VARCHAR2)
    IS
    BEGIN
       FOR c IN (  SELECT TABLE_NAME v_TableName
                     FROM CMSR_MAPPING
                    WHERE TABLE_TYPE != 'W' AND ORDER_SEQ != '0'
                 ORDER BY ORDER_SEQ DESC)
       LOOP
          -- Verify the table name and delete in respectable table --
          --( I always hate when my tables aren't respectable !)
          CASE c.v_TableName
             WHEN 'CMSW_CONTR'
             THEN
                DELETE FROM CMSW_CONTR
                      WHERE CONTR_NBR = parCONTR_NBR;
             WHEN 'CMSW_AMNDS'
             THEN
                DELETE FROM CMSW_AMNDS
                      WHERE CONTR_NBR = parCONTR_NBR;
          END CASE;
       END LOOP;
    END;
    

    Obviously I don't have your data and do not know exactly what is the whole procedure
    but you could not do?

    /* Formatted on 5/20/2011 12:49:07 PM (QP5 v5.149.1003.31008) */
    CREATE OR REPLACE PROCEDURE DeleteData (parCONTR_NBR IN VARCHAR2)
    IS
    BEGIN
       DELETE FROM CMSW_CONTR
             WHERE CONTR_NBR = parCONTR_NBR
                   AND EXISTS
                          (SELECT 1
                             FROM CMSR_MAPPING
                            WHERE     TABLE_TYPE != 'W'
                                  AND ORDER_SEQ != '0'
                                  AND table_name = 'CMSW_CONTR');
    
       DELETE FROM CMSW_AMNDS
             WHERE CONTR_NBR = parCONTR_NBR
                   AND EXISTS
                          (SELECT 1
                             FROM CMSR_MAPPING
                            WHERE     TABLE_TYPE != 'W'
                                  AND ORDER_SEQ != '0'
                                  AND table_name = 'CMSW_AMNDS');
    END;
    

    Published by: pollywog may 20, 2011 12:49

  • Help with oracle sql to get all possible combinations in a table.

    Hello guys I have a small predicatement which has me a little confused. I have a table similar to the following. (It is a sample of my real of the table. I use this to explain the original table containing sensitive data).
    CREATE TABLE TEST01( 
    TUID VARCHAR2(50),
    FUND VARCHAR2(50),
    ORG  VARCHAR2(50));
    Insert into TEST01 (TUID,FUND,ORG) values ('9102416AB','1XXXXX','6XXXXX');
    Insert into TEST01 (TUID,FUND,ORG) values ('9102416CC','100000','67130');
    Insert into TEST01 (TUID,FUND,ORG) values ('955542224','1500XX','67150');
    Insert into TEST01 (TUID,FUND,ORG) values ('915522211','1000XX','67XXX');
    Insert into TEST01 (TUID,FUND,ORG) values ('566653456','xxxxxx','xxxxx');
    "TUID"                        "FUND"                        "ORG"                         
    "9102416AB"                   "1XXXXX"                      "6XXXXX"                      
    "9102416CC"                   "100000"                      "67130"                       
    "955542224"                   "1500XX"                      "67150"                       
    "915522211"                   "1000XX"                      "67XXX"                       
    "566653456"                   "xxxxxx"                      "xxxxx"                       
    The 'X' is wildcard character elements * (I inherit it and I can not change the table format) * I would like to make a query as follows

    select tuid from test01 where fund= '100000' and org= '67130'
    However I like to do is to retrieve all the records that have have these segments in them including ' x
    in other words the output expected here would be

    "TUID"                        "FUND"                        "ORG"                         
    "9102416AB"                   "1XXXXX"                      "6XXXXX"                      
    "9102416CC"                   "100000"                      "67130"                       
    "915522211"                   "1000XX"                      "67XXX"                       
    "566653456"                   "xxxxxx"                      "xxxxx"  
    I started to write a massive sql statement that would have the 12 as the instruction inside, because I must compare the org and finance every possible way.
    This is where im headed. but im wondering if there is a better way.
    select * from test02
    where fund = '100000' and org = '67130'
    or fund like '1%' and org like '6%'
    or fund like '1%' and org like '67%'
    or fund like '1%' and org like '671%'
    or fund like '1%' and org like '6713%'
    or fund like '1%' and org like '67130'
    or fund like '10%' and org like '6%'...etc
    
    /*seems like there should be a better way..*/
    can someone give me a hand to come with this sql statement...

    mlov83 wrote:
    If I run the present

    select tuid,fund, org
    from   test01
    where '100000' like translate(fund, 'xX','%%') and '67130' like translate(org, 'xX','%%');
    

    That's what I

    "TUID"                        "FUND"                        "ORG"
    "9102416AB"                   "1XXXXX"                      "6XXXXX"
    "9102416CC"                   "100000"                      "67130"
    "915522211"                   "1000XX"                      "67XXX"
    "566653456"                   "xxxxxx"                      "xxxxx"
    "9148859fff"                  "1XXXXXX"                     "X6XXX"                       
    

    the last item should be excluded. The second digit in "org" is a "7".

    Fund is bad, too. Looking for 6 characters ("100000"), but the funds on this line is 7 characters ("1XXXXXX").

    and it's always get picked up.

    That's why you should use the Joker _ instead of %

    select  tuid, fund, org
    from    test01
    where  '100000' like translate (fund, 'xX', '__')
    and    '67130'  like translate (org,  'xX', '__')
    ;
    

    It is difficult to see, but in two calls to TRANSLATE, the 3rd argument is a string 2 ' _.

  • Need help with PL/SQL code

    Hi I am writing this code in pl/SQL:

    create or replace
    PROCEDURE 'TESTPRI '.
    (NUMBER pCYC_DT)
    AS
    vTGT_TABL VARCHAR2 (25);
    vSTG_TABL varchar2 (30);
    vsql varchar2 (200);
    BEGIN
    vTGT_TABL: = 'TESTTABL ';
    vSTG_TABL: = vTGT_TABL | » _'|| pCYC_DT;
    vsql: = 'TRUNCATE TABLE ' | vTGT_TABL;
    EXECUTE IMMEDIATE vsql;
    RUN IMMEDIATELY "INSERT" | vTGT_TABL | ' SELECT * FROM '. vSTG_TABL;
    COMMIT;
    -IMMEDIATE 'TRUNCATE TABLE ' | vSTG_TABL;
    END TESTPRI;

    When executing this procedure it gives me following error:
    ORA-03290: Invalid command truncate - lack of key word TABLE or CLUSTER
    ORA-06512: at "DBR. TESTPRI', line 11
    ORA-06512: at line 6

    But I think that the TRUNCATE TABLE statement is correct. Is there a problem with the variable?

    Any help would be appreciated.
    Thank you.

    vsql: = 'TRUNCATE TABLE ' | vTGT_TABL;

    You need space after the TABLE

    vsql:= 'TRUNCATE TABLE ' ||vTGT_TABL ; 
    

    EXECUTE IMMEDIATE vsql;
    RUN IMMEDIATELY "INSERT" | vTGT_TABL | ' SELECT * FROM '. vSTG_TABL;

    Sapce here after INTO, before SELECT and FROM

    EXECUTE IMMEDIATE 'INSERT INTO '|| vTGT_TABL||' SELECT * FROM '|| vSTG_TABL;
    
  • Need help with PHP Muse (JavaScript error... by e-mail)

    Hey all the...

    I searched and did not see an answer to this:

    I exported my Muse file in HTML format and receive this error for my page contact us (email question):

    "JavaScript: PHP Script error form is missing from the web server or PHP is not configured correctly or your web hosting provider."  Check if the script PHP form as been downloaded correctly, then contact your provider for hosting on the configuration of PHP".

    What PHP version support MUSE... 5.1?  I contacted HostGator and they have just updated my PHP to 5.5 and asked me what needs PHP MUSE. Said HostGator 5.1 is old and they don't support 5.1. Can someone help me?

    Also, when I try to check PHP with: http://my-site.com/scripts/form_check.php , I just get an "oops" of the screen, but does not check my PHP. ???

    Thank you

    I don't see a page of Muse generated with a form to www.dancetx.com, or pages that links? Where can I find the page with the form that does not work? Thank you.

    If you Muse site doesn't have a form, which would explain why there is no file "form_check.php" on your site. This file (and the other for a form) are generated only when there is a form within the site uploaded/exported.

  • Need help with PHP form with checkboxes, radio buttons and file as an attachment

    Hi guys,.

    I'm having a nightmare with this PHP form where a user can fill it out, attach a doc/pdf and submit. After trying to sort out with the previous code, I used, I have stripped try and think that I should start again just in the hope that you geniuses can help!

    Here is the HTML code of the contact.php:

    <form action="" method="post" name="contact" id="contact">
    
        <p>Job Title:*<br />
        <input name="position" type="text" /></p>
    
        <p>Nationality:*<br />
        <select name="nationality">
          <option value="">-- select one --</option>
          <option value="Afghan">Afghan</option>
          <option value="Albanian">Albanian</option>
          <option value="Algerian">Algerian</option>
          <option value="Zambian">Zambian</option>
          <option value="Zimbabwean">Zimbabwean</option>
        </select>
        </p>
        
        <p>Which country are you currently living in?*<br />
        <select name="country">
        <option value="">-- select one --</option>
        <option value="United Kingdom">United Kingdom</option>
        <option value="Afghanistan">Afghanistan</option>
        <option value="Africa">Africa</option>
        <option value="Zambia">Zambia</option>
        <option value="Zimbabwe">Zimbabwe</option>
        </select>
        </p>
        
        <label class="radio" for="checkRight">Yes/No question?</label><br />
        <input class="radio" type="radio" name="right" value="Yes" /> Yes
        <input class="radio" type="radio" name="right" value="No" /> No
        <input class="radio" type="radio" name="right" value="N/A" /> Not applicable
        
        <p>Yes/No question?<br />
        <select name="continue">
        <option value="">-- select one --</option>
        <option value="Yes">Yes</option>
        <option value="No">No</option>
        </select>
        </p>
        
        <p>Select your resorts:<br />
        Resort 1<input name="res1" type="checkbox" value="Resort 1" />
        Resort 2<input name="res2" type="checkbox" value="Resort 2" />
        Resort 3<input name="res3" type="checkbox" value="Resort 3" />
        Resort 4<input name="res4" type="checkbox" value="Resort 4" />
        Resort 5<input name="res5" type="checkbox" value="Resort 5" />
        Resort 6<input name="res6" type="checkbox" value="Resort 6" />    
        </p>
        
        <p>Don't send form unless this is checked:* <input type="checkbox" name="parttime" value="Yes" /></p>
        
        <p>Date of arrival: <input name="arrive" id="datepick" /><br />
        Date of departure: <input name="depart" id="datepick2" /></p>
        
        <script type="text/javascript" src="assets/scripts/datepickr/datepickr.js"></script>
        <link href="assets/scripts/datepickr/datepickr.css" rel="stylesheet">
        
        <script type="text/javascript">
        new datepickr('datepick');
        new datepickr('datepick2', {
        });
        </script>
        
        
        <p>Name:*<br />
        <input name="name" type="text" /></p>
        
        <p>E-mail:*<br />
        <input name="email" type="text" /></p>
        
        <p>Telephone:*<br />
        <input name="telephone" type="text" class="ctextField" /></p>
        
        <p>Upload CV (Word of PDF formats only):<br />
        <input type="file" name="cv" class="textfield"></p>
        
        <p><input name="submit" value="Submit Enquiry" class="submitButton" type="submit" /><div style="visibility:hidden; width:1px; height:1px"><input name="url" type="text" size="45" id="url" /></div></p>
    
    </form>
    

    Furthermore, the work of date boxes so excuse Javascript in there!

    To avoid SPAM, I used something where there is a hidden URL field that should be left blank for the form to submit you see in PHP.

    Here's where I am with the PHP which is placed above the heading of contact.php...

    <?php
    
    if (array_key_exists('submit', $_POST)) {
        $position = $_POST['position'];
        $arrive = $_POST['arrive'];
        $nationality = $_POST['nationality'];
        $parttime = $_POST['parttime'];
        $depart = $_POST['depart'];
        $name = $_POST['name'];
        $email = $_POST['email'];
        $telephone = $_POST['telephone'];
    
    $to = "[email protected]";
    $subject = "Recruitment Application";
    
    $message = $headers;
    $message .= "Name: " . $_POST["name"] . "\r\n";
    $message .= "E-mail: " . $_POST["email"] . "\r\n";
    
    $headers  = "MIME-Version: 1.0\r\n";
    $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
    $headers .= "Reply-To: " . $_POST["email"] . "\r\n";
    $headers .= 'From: My Website <[email protected]>' . "\r\n";
    
    
    
    $message= "
    ";
    
    $url = stripslashes($_POST["url"]);
    if (!empty($url)) {
    header( 'Location: http://www.go-away-spam-robots.com' );
    exit();
    }
    
    if (!isset($warning)) {
    mail($to, $subject, $message, $headers);
    header( 'Location: http://www.mywebsite.co.uk/sent.php' );
    }
    
    }
    
    ?>
    

    I would like to make virtually all of the mandatory field so if a field is left empty (other than the hidden URL field), a warning message is displayed next to this field.

    Also, I would like that the file upload field to attach to the e-mail address that is sent to me and the results come through me in a table.

    Can someone help me get my form to work?

    Thank you and I hope to hear from you!

    SM

    Either way, the url of your custom success page must go inside the thanks_page variable:

    $thanks_page [0] = "Success.php";

    Nancy O.

  • Need help with PHP syntax error

    I fight with this error message ""Parse error: syntax error, unexpected T_IF ' for the 66 line that I get. " Here is the code that I use that I got with the help of the users of this site, which is supposed to launch a search for multiple parameters on a mysql database. The red text is the line 66. I just starting to learn PHP and I can not know what to do with it. Is it possible to have two if statements following each other like this? In addition, as I said, I was given this code from the help of this forum, but I don't understand what the purpose is of the $where variable. This code will work also without it? Thanks in advance for any help.

    $query_rsMainItems = ' SELECT * FROM mainitems; $where = false; If (isset($_GET['category']) & &! empty($_GET['category'])) {$. query_rsMainItems = 'category WHERE ='.} GetSQLValueString ($_GET ['category'], 'text');      $where = true; } If (isset($_GET['price']) & &! empty($_GET['price'])) {if ($where) {$query_rsMainItems. = 'AND';}}   } else {$. query_rsMainItems = "WHERE";}     $where = true;   } $query_rsMainItems. = 'price ='. GetSQLValueString ($_GET ['price'], 'text'); } If (isset($_GET['time1']) & &! empty($_GET['time1'])) {if ($where) {$query_rsMainItems. = 'AND';}}   } else {$. query_rsMainItems = "WHERE";}     $where = true;   } $query_rsMainItems. = '(EDT) 1 ='. GetSQLValueString ($_GET ['time 1'], 'text'); } If (isset($_GET['time2']) & &! empty($_GET['time2'])) {if ($where) {$query_rsMainItems. = 'AND';}}   } else {$. query_rsMainItems = "WHERE";}     $where = true;   } $query_rsMainItems. is 'time2 ='. GetSQLValueString ($_GET ['time2'], 'text'); } If (isset($_GET['city']) & &! empty($_GET['city'])) {if ($where) {$query_rsMainItems. = 'AND';}}   } else {$. query_rsMainItems = "WHERE";}     $where = true;   } $query_rsMainItems. = 'city ='. GetSQLValueString ($_GET ['city'], 'text'); } If (isset($_GET['zip']) & &! empty($_GET['zip'])) {if ($where) {$query_rsMainItems. = 'AND';}}   } else {$. query_rsMainItems = "WHERE";}     $where = true;   } $query_rsMainItems. = 'zip ='. GetSQLValueString ($_GET ['zip'], 'text'); } If (isset($_GET['neighborhood']) & &! empty($_GET['neighborhood'])) {if ($where) {$query_rsMainItems. = 'AND';}}   } else {$. query_rsMainItems = "WHERE";}   } $query_rsMainItems. = 'quarter ='. GetSQLValueString ($_GET ['suburb'], 'text');

    I copied and pasted the code in a local page. Aside from a missing brace after the last line ($query_rsMainItems. = 'quarter ='.) GetSQLValueString($_GET['neighborhood'], 'text');), it works perfectly.

    The error message is a unexpected T_IF in line 66. This means that the PHP engine is not expected a conditional clause at this time here. In all likelihood, there is an error at an early stage in the code, which resulted in an unmatched brace.

    The code I provided works. I tested completely before posting originally and tested again. The problem is that I tested it in isolation from the rest of the code in your page. Without seeing the whole page, it is impossible to determine where the error is located.

  • IP number looking for PSI - need help with a sql solution better and faster

    Hello

    I have a table (one) with more 1 000 000 IP addresses and numbers (the digital equivalent of the IP address)

    I have a second table (b) which contains a mapping between the ranges of the ISP and IP. The table looks like this and more contains 150 000 entries:

    BEGIN_IP_RANGE END_IP_RANGE ISP_NAME

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

    600000000 700000000 ISP_X

    800000000 900000000 ISP_Y

    I'm creating a third table (c) which connects (a) IP numbers to identify the ISP from (B). The query looks like this:

    CREATE TABLE c

    AS

    Select a.IP_ADDRESS

    b.ISP_NAME

    IP_NUMBERS a, ISP_LOOKUP b lkp

    where a.IP_NUMBER between b.BEGIN_IP_RANGE and b.END_IP_RANGE

    ;

    There is no key join between the 2 tables and so I use TO search for the access provider. The performace of it's terrible and table (c) takes several hours to create.

    Does anyone have any thoughts/ideas/suggestions on how this research can be achieved by using a solution better and faster?

    Thank you very much

    Shah

    The performace of it's terrible and table (c) takes several hours to create.

    Hours what do you say?

    See if the following can help.

    Cardinalities are similar to yours. The ETG takes 7sec. :

    SQL> create table ip_numbers (ip_address, ip_number) as
      2  select cast(to_char(level,'fm099G999G999G999', 'nls_numeric_characters=,.') as varchar2(15))
      3       , level
      4  from dual
      5  connect by level <= 1000000 ;
    
    Table created.
    
    SQL> select * from ip_numbers where rownum <= 10;
    
    IP_ADDRESS       IP_NUMBER
    --------------- ----------
    000.000.000.001          1
    000.000.000.002          2
    000.000.000.003          3
    000.000.000.004          4
    000.000.000.005          5
    000.000.000.006          6
    000.000.000.007          7
    000.000.000.008          8
    000.000.000.009          9
    000.000.000.010         10
    
    10 rows selected.
    
    SQL>
    SQL> create table isp_lookup (begin_ip_range, end_ip_range, isp_name) as
      2  select 1 + (level-1)*5
      3       , level*5
      4       , cast('ISP_'||to_char(level,'fm099999') as varchar2(10))
      5  from dual
      6  connect by level <= 200000 ;
    
    Table created.
    
    SQL> select * from isp_lookup where rownum <= 10;
    
    BEGIN_IP_RANGE END_IP_RANGE ISP_NAME
    -------------- ------------ ----------
                 1            5 ISP_000001
                 6           10 ISP_000002
                11           15 ISP_000003
                16           20 ISP_000004
                21           25 ISP_000005
                26           30 ISP_000006
                31           35 ISP_000007
                36           40 ISP_000008
                41           45 ISP_000009
                46           50 ISP_000010
    
    10 rows selected.
    
    SQL> create index ip_address_number_ix on ip_numbers (ip_number);
    
    Index created.
    
    SQL> set timing on
    SQL>
    SQL> create table ip_mappings as
      2  select /*+ use_nl(a b) */
      3         a.ip_address
      4       , b.isp_name
      5  from isp_lookup b
      6       join ip_numbers a on a.ip_number between b.begin_ip_range
      7                                            and b.end_ip_range
      8  ;
    
    Table created.
    
    Elapsed: 00:00:06.94
    SQL> select count(*) from ip_mappings;
    
      COUNT(*)
    ----------
       1000000
    
    Elapsed: 00:00:01.22
    
  • Need help with Oracle SQL merge records according to date and term dates

    Hi all

    I need help to find this little challenge.

    I have groups and flags and effective dashboards and dates of term against these indicators according to the following example:

    GroupName Flag_A Flag_B Eff_date Term_date
    Group_ATHERETHERE2011010199991231
    Group_ANN2010010120101231
    Group_ANN2009010120091231
    Group_ANN2006010120081231
    Group_ANTHERE2004010120051231
    Group_ATHERETHERE2003010120031231
    Group_BNTHERE2004010199991231
    Group_BNTHERE2003010120031231

    As you can see, group_A had the same combination of (N, N) flag for three successive periods. I want to merge all the time periods with the same indicators in one. Where entry into force will be the most early (underlined) time period and end date will be later (underlined)

    So the final result should look like this:

    GroupName Flag_A Flag_B Eff_date Term_date
    Group_ATHERETHERE2011010199991231
    Group_ANN2006010120101231
    Group_ANTHERE2004010120051231
    Group_ATHERETHERE2003010120031231
    Group_BNTHERE2003010199991231

    Thanks for your help

    Here's the DDL script

    drop table TMP_group_test;

    create table TMP_group_test (groupname varchar2 (8))

    , flag_a varchar2 (1)

    , flag_b varchar2 (1)

    , eff_date varchar2 (8)

    , term_date varchar2 (8)

    );

    insert into TMP_group_test values ('Group_A', 'Y', 'Y', ' 20110101 ', ' 99991231');

    insert into TMP_group_test values ('Group_A', 'n', ' n ', ' 20100101 ', ' 20101231');

    insert into TMP_group_test values ('Group_A', 'n', ' n ', ' 20090101 ', ' 20091231');

    insert into TMP_group_test values ('Group_A', 'n', ' n ', ' 20060101 ', ' 20081231');

    insert into TMP_group_test values ('Group_A', 'n', 'Y', ' 20040101 ', ' 20051231');

    insert into TMP_group_test values ('Group_A', 'Y', 'Y', ' 20030101 ', ' 20031231');

    insert into TMP_group_test values ('Group_B', 'n', 'Y', ' 20040101 ', ' 99991231');

    insert into TMP_group_test values ('Group_B', 'n', 'Y', ' 20030101 ', ' 20031231');

    commit;

    Post edited by: user13040446

    It is the closest, I went to the solution


    I create two rows;

    Rnk1: partition by group name, order of eff_date / / desc: this grade will sort the records of the most recent and handed to zero for each group\

    Rnk2: (dense) partition by group name, flag_A, flagb: this grade for each combination of group\flag gives a number so that they are classified as "families".

    Then I use the function analytic min

    Min (eff_date) more (partition of GroupName, rnk2): the idea is that, for each Member of the same family, the new date is the min of the family (and the max for the date of the term), at the end I just need separate so that the duplicates are gone

    Now the problem. As you can see from the query below, records of 1 and 6 (as identified by rownum) are identified in the same family, because they have the same combination of flag, but they are not successive, so everyone must keep its own date of entry into force.

    If only I can make the distinction between these two that would solve my problem


    Query:


    Select rowNum,GroupName, flag_a, flag_b, eff_date, term_date, rnk1, rnk2

    , min (eff_date) more than (partition by GroupName rnk2( ) min_eff

    Of

    (

    Select rowNum,

    GroupName , flag_a , flag_b , eff_date , term_date

    rank() more than (partition by GroupName stopped by eff_date desc) rnk1

    DENSE_RANK() more than (partition by GroupName order by flag_A flag_B ( ) rnk2

    de dsreports . tmp_group_test

    ) order by rowNum

    Hello

    user13040446 wrote:

    Hi KSI.

    Thanks for your comments, you were able to distinguish between these lines highlight, but lost lines 2,3,4 which are supposed to have the same date min = 20060101.

    Please see the table wanted to see the final result I want to reach

    Thanks again

    This first answer is basically correct, but in the main query, you want to use the function MIN, not the analytical function aggregation and GROUP BY columns with common values, like this:

    WITH got_output_group AS

    (

    SELECT GroupName, flag_a, flag_b, eff_date, term_date

    ROW_NUMBER () OVER (PARTITION BY GroupName

    ORDER BY eff_date

    )

    -ROW_NUMBER () OVER (PARTITION BY GroupName, flag_a, flag_b)

    ORDER BY eff_date

    ) AS output_group

    OF tmp_group_test

    )

    SELECT GroupName, flag_a, flag_b

    MIN (eff_date) AS eff_date

    MAX (term_date) AS term_date

    OF got_output_group

    GROUP BY GroupName, flag_a, flag_b

    output_group

    ORDER BY GroupName

    eff_date DESC

    ;

    The result I get is

    GROUP_NA F F EFF_DATE TERM_DAT

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

    Group_A Y 20110101 99991231 Y

    N Group_A 20101231 20060101 N

    Group_A N 20051231 20040101 Y

    Group_A Y Y 20031231-20030101

    Group_B N Y 99991231 20030101

    which is what you asked for.

Maybe you are looking for

  • Cannot delete the spam addon

    I just noticed an icon on the right end of my search bar, next to my favorites, downloads, the icon of the House and left my menu button. I guess that's a complement, even if when I list my addons they seem to be taken into account. He appears as a n

  • Satellite L300-1F8 - how to uninstall Toshiba Power Saver?

    Hello I have Windows 7 on my laptop. Accidentally, I installed the saver of energy for XP and I can't uninstall it (error 0x7E). Do you know how to uninstall it?

  • Pavilion b 20, 314: Auto loop

    Difficulty out of the automatic repair loop so that I can perform a system recovery. I changed the settings on the computer to boot from the CD/DVD. I use system recovery discs that I bought from HP.  Computer startup with recovery disc in dvd but ne

  • "He's dead, Jim" error on shutdown

    I have an acer that keeps closing ramdomly andright before his stop a black screen with a form of pieice image and the words he's dead jim apear. below the piece of the puzzle, he reads something I can't read fast enough before, but he's going to the

  • my pc does not recognize my usb camera, what can I do

    my pc does not recognize my usb camera, what can I do