How to read/select only the records from a table with non-English characters

Hello
I need to find all records in a table with non-English (mainly Chinese) characters in at least one of the varchar2 columns. Let me kow if someone knows a way by which it can be done using SQL/PLSQL.

Best regards
Imran
select * from your table
where your_column != convert(your_column, 'UTF8', 'US7ASCII)

Replace UTF8 with your database character set

Published by: thtsang on October 15, 2009 03:53 - unequal sign change of! =

Tags: Database

Similar Questions

  • How can I select only the records that have more than 1 attached userID?

    gurus of the afternoon...

    As queries title, I can't find examples by searching the forum then...

    Basically, I need to find all the web_user_ids who have more than 1 attribute_code of 'ICX_HR_PERSON_ID' in the table... I tried this but its is not as much as I think it should...

    SELECT web_user_id, attribute_code, number_value, COUNT (web_user_id)
    AS "Num of administrators."
    OF AK_WEB_USER_SEC_ATTR_VALUES
    -WHERE attribute_code = 'ICX_HR_PERSON_ID '.
    - AND web_user_id = '4123'
    Web_user_id GROUP, attribute_code, number_value
    SEEN (COUNT (web_user_id) > 1)
    ORDER BY web_user_id ASC;

    Val

    J

    Try:

    SELECT web_user_id, attribute_code, COUNT(web_user_id)
    AS "Num Of Administrators"
    FROM AK_WEB_USER_SEC_ATTR_VALUES
    WHERE attribute_code = 'ICX_HR_PERSON_ID'
    GROUP BY web_user_id, attribute_code
    HAVING (COUNT(web_user_id) > 1 )
    ORDER BY web_user_id ASC;
    

    Or, better, there is no need to extract the attribute_code:

    SELECT web_user_id, COUNT(web_user_id) AS "Num Of Administrators"
    FROM AK_WEB_USER_SEC_ATTR_VALUES
    WHERE attribute_code = 'ICX_HR_PERSON_ID'
    GROUP BY web_user_id
    HAVING (COUNT(web_user_id) > 1 );
    

    Max

    Published by: Massimo Ruocchio, November 12, 2009 16:28

  • help in registration of the records from two tables

    HI: I have two tables joined the first field. The field is the primary key in the first table. Need help listing records from both tables with each a line/record results.
    create table EVENTS (
    event_key varchar2(64) primary key,
    event_description varchar2(64),
    create_time int
    );
    
    
    create table EVENT_UPDATES (
    event_key varchar2(64) NOT NULL ,
    update_description varchar2(64),
    update_time int
    );
    
    
    insert into EVENTS values('Event1', 'This is event1', 1);
    insert into EVENT_UPDATES values('Event1', 'Ticket created', 3);
    insert into EVENT_UPDATES values('Event1', 'Event cleared', 10);
    insert into EVENTS values('Event2', 'This is event2', 4);
    insert into EVENT_UPDATES values('Event2', 'Ticket created', 6);
    insert into EVENT_UPDATES values('Event2', 'Event cleared', 8);
    I want to print each record in the table of EVENTS such as a line and the corresponding records in EVENT_UPDATES as a line like this record
    Event1   1     This is event1
                3     Ticket created
                10   Event cleared
    Event2   4     This is event2
                6     Ticket created
                8     Event cleared
    TIA
    Ravi
    select  case weight
              when 1 then event_key
            end key,
            time_val,
            description
      from  (
              select  event_key,
                      create_time time_val,
                      event_description description,
                      1 weight
                from  events
             union all
              select  event_key,
                      update_time,
                      update_description,
                      2 weight
                from  event_updates
            )
      order by event_key,
               weight
    /
    
    KEY          TIME_VAL DESCRIPTION
    ---------- ---------- -------------------------
    Event1              1 This is event1
                        3 Ticket created
                       10 Event cleared
    Event2              4 This is event2
                        6 Ticket created
                        8 Event cleared
    
    6 rows selected.
    
    SQL> 
    

    SY.

  • How can I select all the cells in an AdvancedDataGrid with ActionScript?

    How can I select all the cells in an AdvancedDataGrid with ActionScript? I selectionMode = "multipleCells" and designViewDataType = "flat".
    Basically, I have a contextmenu and want to add a "select all" option.

    Thank you

    Yes you can do in actionscript as well.
    If selectionMode is set to multipleCells then:
    Section A Code attached

    If selectedMode is set to multipleRows, then there are two ways to do it.
    1 - the solution is given by Bryan Dresselhaus in his last message.
    2-section B in the attached Code

  • Help with the query to select only one record from the result set in double

    Hello

    Please help with the query. Version of Oracle database we use is 10g R2.

    I have a vision that is duplicated IDS, but they are used across the different functions. See below examples of data. Please help me with a query to select only one record (based on ID regardless of the area) from the bottom of the result set of duplicate records. For what is the point of view is there unique records, given the combination of the fields ID, Org, DF, dry, Sub-Sec

    ID
    Org
    DF
    Sec Sub-Sec

    (163)CQCPDMCPDMHD(163)PCENGENGENG(163)CQASICASICIS8888TSTACTACTAC(163)TSHEHESW6789CQINFOINFOFOS6789PCSECSYSSECSYSINFO16789TSSECSYSSECSYSINFO29009PCBMSBMSBMS1

    My result set must eliminate the duplicate identifiers regardless of whoever we choose of the result set. (I mean without distinction Org, DF, s, Sub-s). My expected result set should be.

    ID
    DSB

    DF
    SEC
    Sub-Sec
    (163)CQCPDMCPDMHD8888TSTACTACTAC6789CQINFOINFOFOS9009PCBMSBMSBMS1


    Thank you

    Orton

    Hello

    This sounds like a job for ROW_NUMBER:

    WITH got_r_num AS

    (

    SELECT id, DSB, df, s, sub_sec org

    ROW_NUMBER () OVER (PARTITION BY ID.

    ORDER BY org

    ) AS r_num

    OF view_x

    )

    SELECT id, DSB, df, sub_sec s,

    OF got_r_num

    WHERE r_num = 1

    ;

    He is a Top - N query example, where you choose the elements of N (N = 1 in this case) from the top of an ordered list.

    I hope that answers your question.
    If not, post a small example of data (CREATE TABLE and INSERT, only relevant columns instructions) to your sample data and the results desired from these data.  (I know that you said that you were a view selection.  Just for this thread, pretending it is a picture and post simple CREATE TABLE and INSERT statements to simulate your point of view).
    Point where the above query is to produce erroneous results, and explain, using specific examples, how you get the right results from data provided in these places.  (I didn't quite understand the explanation above.  I don't know why you want to

    ID ORG DF DRY SUB_SEC

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

    1234 CQ DPRK DPRK HD

    and is not

    1234 IS CQ ASIC, ASIC

    or

    TS 1234 IT IT SW

    or

    1234 CQ ASIC ASIC HD

    )
    If you change the query at all, post your modified version.
    Always say what version of Oracle you are using (for example, 11.2.0.2.0).

    See the FAQ forum: https://forums.oracle.com/message/9362002

  • How can I select only the lowest layer?

    On the Adobe site, he States:

    If you need the lowest layer selected, press Option + shift + -[.]

    Well, it does not work for me in all cases as if another layer is selected, both end up being selected.

    Inside of an Action, how can I select the lowest layer and only the lowest layer?

    And while I ask questions of Action, in an existing action, how do I start recording so that the new shares are placed right at the top? If I select the name of the Action, the new record is placed in the lower part. If I select the first element, the new record is ranked second.

    See if Option +, (comma) selects the lower layer.

    And Option +. (period) selects the top layer.

  • retrieve the records from the oracle sql query

    Hello

    I'm stuck with a requirement where I need to retrieve some recordset based on the conditions. I won't be able to produce the same data and table here, but I can explain the problem with the example statement:

    If col2 contains 'y' to any folder, then select only the records. Where, as if no line contains the value 'y' for col2 then retrieve all records.

    Database version: Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64 bit Production

    with temp (col1,col2)
    as
    (select level,decode(mod(level,2),0,'y',1,'n')
    from dual
    connect by level < 10)
    select * from temp;
    
    

    Please help, if possible through sql.

    Thank you

    Vikram

    Something like below... Considered as non-null column col2...

    with the temp (col1, col2)

    as

    (select level, decode (mod(level,2), 0, 'y', 1,' no))

    of the double

    connect by level<>

    Select * from temp

    WHERE col2 = NVL ((SELECT col2 FROM temp OÙ col2 = 'y' ET rownum = 1), col2);

  • How to select columns, that we need a table with pivot

    Hello

    How can I select only the required columns that I need the table

    My goal is to keep everything in one line

    Database: 11.2.0.2.0

    I have a table called Table Agent

    create the table AGENT_DETAIL

    (

    agent_id NUMBER (20) not null,

    agent_type_code VARCHAR2 (10) not null,

    agent_type_prefix VARCHAR2 (10) not null,

    Type_Code VARCHAR2 (10) not null,

    type_prefix VARCHAR2 (10) not null,

    last_modified DATE not null

    )

    INSERT INTO agent_detail VALUES

    (29709, ARE ',' OFFICE ',' DNSWEB ',' AGTDETAILS', SYSDATE);

    INSERT INTO AGENT_DETAIL VALUES

    (29709, ARE ',' OFFICE ',' DNSNATID ',' AGTDETAILS', SYSDATE);

    INSERT INTO AGENT_DETAIL VALUES

    (29709, ARE ',' OFFICE ',' DELIVERY ',' AGTDETAILS', SYSDATE);

    INSERT INTO AGENT_DETAIL VALUES

    (29709, ARE ', 'OFFICE', "WEBUSAGE", "WEBUSER" SYSDATE);

    When you query it against the table

    SELECT * FROM AGENT_DETAIL;

    AGENT_IDAGENT_TYPE_CODEAGENT_TYPE_PREFIXTYPE_CODETYPE_PREFIXLAST_MODIFIED
    129709REOFFICEDNSWEBAGTDETAILS22:14:15 12/09/2015
    229709REOFFICEDNSNATIDAGTDETAILS09/12/2015-22:15:26
    329709REOFFICEDELIVERYAGTDETAILS09/12/2015-22:21:37
    429709REOFFICEWEBUSAGEWEBUSER10/12/2015-09:27:52

    Because my goal is to put everything in a single line instead of get in 4 rows

    My query is like that

    (select *)

    the Dungeon of pivot (min (TYPE_CODE) AGENT_DETAIL (last dense_rank command by LAST_MODIFIED) for TYPE_CODE in ('DNSWEB' as the WEB)

    'DNSNATID' as

    NATIONAL,

    'DELIVERY' AS

    DELIVERY,

    "WEBUSAGE" AS WEBUSAGE

    )

    ))

    Result:

    AGENT_IDAGENT_TYPE_CODEAGENT_TYPE_PREFIXTYPE_PREFIXWEBNATIONALDELIVERYWEBUSAGE
    129709REOFFICEWEBUSERWEBUSAGE
    229709REOFFICEAGTDETAILSDNSWEBDNSNATIDDELIVERY

    Is it possible to get everything in one record, I know that I have two type_prefixes different (WEBUSER, AGTDETAILS)

    But all I want to see my data is like this

    Agent_id Agent_type_code Agent_type_prefix WEB WEBUSAGE NATIONAL DELIVERY

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

    RE OFFICE DNSWEB DNSATID DELIVERY WEBUSAGE 29709

    Hello

    When you use SELECT... PIVOT, the result set contains 1 row for all the distinct combinations of the values of all columns except columns mentioned in the PIVOT clause.  If you want to ignore some columns completely, then let the PIVOT operated at a "table" that does not include the.  For example:

    with RELEVANT_AGENT_DETAIL as

    (

    Select AGENT_ID, AGENT_TYPE_CODE, AGENT_TYPE_PREFIX, TYPE_CODE, LAST_MODIFIED

    of AGENT_DETAIL

    -where--if you filter, put it here

    )

    Select *.

    of RELEVANT_AGENT_DETAIL

    Pivot (min (TYPE_CODE) Dungeon (last dense_rank command by LAST_MODIFIED))

    for TYPE_CODE in ('DNSWEB' as WEB

    'DNSNATID' as NATIONAL

    'DELIVERY' as DELIVERY

    "WEBUSAGE" as WEBUSAGE

    )

    )

    ;

    If you are lazy or trying to be cute, maybe you can give the columns unwanted some lazy jobs in the PIVOT clause, like this:

    Select *.

    of AGENT_DETAIL

    Pivot (min (TYPE_CODE) Dungeon (dense_rank last order by LAST_MODIFIED)

    TYPE_CODE

    TYPE_PREFIX

    )

    for TYPE_CODE in ('DNSWEB' as WEB

    'DNSNATID' as NATIONAL

    'DELIVERY' as DELIVERY

    "WEBUSAGE" as WEBUSAGE

    )

    )

    ;

    But this makes the code confusing and may be difficult to maintain.

  • Count records in different tables with a condition

    Hello

    I would like to ask for your help. I want to count the records from multiple tables at the same time. These tables have a common column with them with a date data type. The output I want is to see the records in the tables with a condition of the column_date < (specified date).


    as of:

    Select count (*) from (the_tables) where (column_date), (specific_date)


    Your help would be much appreciated.

    Hello

    || ' WHERE ITEMDATE <= 8/1/2008;';
    

    With the Frank remark about the mistake, another good practice would be to use a connection variable:

    script_sql := 'SELECT COUNT (*) FROM '
    || r_1.owner
    || '.'
    || r_1.table_name
    || ' WHERE ITEMDATE <= :1';
    
    ...
    
    EXECUTE IMMEDIATE script_sql
    INTO this_cnt
    USING to_date('08/01/2008','DD/MM/YYYY');
    
  • data from 3 tables with later dates

    Hello
    Need help with the PL/SQL code, I need to write a code that will get the data from 3 tables with the most recent date.

    For an individual ACT_CODE the output of the SQL query should display the data including the last dates back to 3 tables, if there is no
    Date of the table, it should show the remaining data (think that the left join will do here)

    Names of tables:
    Institution_UPDT aiu
    AC ASQ_CONTACT
    GR_AUTHORIZE gr

    All 3 tables have ACT_Code in common

    Column names

    INSTITUTION_UPDT IAU - IAU. ACT_CODE, AIU.project_id as proj, IAU. UPDT_TYPE_ID, IAU. User_id, IAU. UPDT_DATE

    ASQ_CONTACT ac - ac. ACT_CODE as contact_code, ac.project_id, ac.first_name, ac.middle_initial, ac.last_
    Name, AC.title, AC. Status, AC.status_date

    GR_AUTHORIZE gr - GR ACT_CODE as grad_code, gr.name, gr.title AS grad_title, gr.submit_date


    Are the names of the columns date
    AC.status_date,
    IAU. UPDT_DATE and
    Gr.submit_date

    Thanks to you all
    appreciate your help

    Jesh

    Hi, Ngoumba,

    If a given ACT_Code couldn't miss from any of the tables, then you will use better full outer joins, not a join left outer.

    Perhaps it would be more effective to make a UNION of the three tables, then rotate the results in three datecolumns.

    You can use the GROUP BY aggregation to get the last date for each ACT_Code in each table.
    If you need other columns in the row which is the last date, you can use the ROW_NUMBER analytic function, like this:

    SELECT  ACT_Code
    ,     updt_date
    ,     ROW_NUMBER () OVER ( PARTITION BY  ACT_Code
                              ORDER BY          updt_date     DESC
                      ) AS r_num
    FROM    institution_updt
    

    The lines with r_num = 1 are the most recent

    This is a technique of ot the UNION-PIVOT example:

    WITH     union_data     AS
    (
         SELECT    ACT_Code
         ,       MAX (updt_date)     AS last_date
         ,       1                  AS table_id
         FROM       institution_updt
         GROUP BY  ACT_Code
    UNION ALL
         SELECT    ACT_Code
         ,       MAX (status_date)     AS last_date
         ,       2                  AS table_id
         FROM       ASQ_Contact
         GROUP BY  ACT_Code
    UNION ALL
         SELECT    ACT_Code
         ,       MAX (submit_date)     AS last_date
         ,       3                  AS table_id
         FROM       GR_Authorize
         GROUP BY  ACT_Code
    )
    SELECT       ACT_Code
    ,       MAX (CASE WHEN table_id = 1 THEN last_date END)     AS aiu_updt_date
    ,       MAX (CASE WHEN table_id = 2 THEN last_date END)     AS ac_status_date
    ,       MAX (CASE WHEN table_id = 3 THEN last_date END)     AS gr_submit_date
    FROM       union_data
    GROUP BY  ACT_Code
    ORDER BY  ACT_Code
    ;
    

    Published by: Frank Kulash, on September 16, 2009 15:02
    Added UNION-pivot example

  • How can I select only a part of a page to analyze instead of having to scan the entire page?

    On my old Epson scanner I could do a preview and select only a position from one page to analyze.  In the garden of Image with my MX 6320, the only option is to scan the entire page.

    How can I select what I want scan before scanning?

    Thank you

    Allen

    Hello

    Mac 10.9.4.  I called Canon and the Lady walked me through what I need to know.  She told me to get rid completely of my kindergarten picture on my Mac, then in the utility scan select Scan speed and now I get a preview window where I can choose the portion I want scanned.

    Thank you

    Allen

  • How to read or get the current selected value of selectonechoice

    How to read or get the current selected value of selectonechoice, so that it can be used in the custom query.

    selectOneChoice11.getValue () m:System.NET.SocketAddress.ToString () returns the index of the list.

    from 0 - number of values in selectonechoice.

    I want to read the exact value of selected.

    Concerning

    Niaz M

    Why don't you try this?

    Re: Value of SelectOneChoice in valueChangeListener

    Both approaches will work...

    Julian

  • How can I print only the part selected a page?

    When I highlite prints part of the entire page. How can I print only the part selected page?

    Try:

    Highlite your text

    Press CTRL + P to start the print menu

    "All" is selected by default in the scope . Change it by selecting 'selection ', and then click OK.

    This example shows only the text that is selected. Microsoft® Security MVP, 2004-2009

  • How can I select the files in a folder with the help of a list with the files you want and after that rename only the files using another list with desired new names?

    How can I select the files in a folder with the help of a list with the files you want and after that rename only the files using another list with desired new names?

    I have only:
    D: / images (where are necessary + not need files)
    -a list with only the necessary files
    -a list with new names for the files needed
    Thank you.

    Hi Pustiu,

    Thanks for posting in the Microsoft Community.

    You want to know how to select the files in a folder using a list with the files you want and after that rename only the files using another list with desired new names.

    I would have you post your query in the TechNet forums because it caters to an audience of it professionals.

    Your query will be better addressed there.

    Check out the link-

    http://social.technet.Microsoft.com/forums/en-us/w7itprogeneral/threads

    We know if you need help. We will be happy to help you. We, at tender Microsoft to excellence.

    Thank you.

  • How to select only the objects in a marquee?

    I am a new user of Illustrator CS5, switching from Freehand. I'm trying to find out if there is a way to select only the objects in a marquee? In AutoCAD, you can make a selection on the left window to the right and only those objects entirely in the window are selected. If you the window right on the left all the objects that are "crossed" or affected by the window are selected. Is there a similar technique in Illustrator?

    Currently, I have to select the objects, and then go back and hold the SHIFT key to deselect the object I don't want, or lock layers to prevent additional items get selected.

    NO.

Maybe you are looking for