Using distinct and sequences

I have a problem that I'm sure has a simple solution.
I'm trying to insert unique records into one table from another table that has duplicates. However, I cant use the sequence for my primary key with the distinct operator. eg.:
INSERT INTO unique_table (pkey,fkey,name)
SELECT DISTINCT seq.nextval, col1, col2
FROM dup_table;
it is the combination of fields col1 and col2 that must be unique. Please help.

correct, the distinct clause returns unique rows. you could
create a trigger for your table then just insert your dup_tab
into the uniq_tab
insert into uniq_tab (select distinct col1,col2 from dup_tab);
with the trigger, your dup_tab will be populated with uniq
rows on col1,col2
Hope this helps
Jay

Similar Messages

  • Using distinct and orderby in the select statment

    Hi All,
    Can anyone tell me what is the purpose of using distinct and orderby in the select statment.

    Hi,
    Using the distinct function with more than one column yields some substantial results. SQL will return the rows with distinct or unique combinations of those columns. Assume this same employee table has another column including the salary of each employee. With the use of the distinct function we can pull a list of unique job titles - salaries.
    SQL Code:
    SELECT DISTINCT job_titles, salary FROM employees;
    SQL has returned all the rows with unique combinations of job titles and salaries. Any duplicate combinations of job titles and salaries will be ignored. For example if we had two CEOs in the table making the same salary each year, only one row would be returned but if we had two CEOs with different salaries, both rows would be returned.
    Order by
    The SQL ORDER BY clause comes in handy when you want to sort your SQL result sets by some column(s). For example if you want to select all the persons from the already familiar Customers table and order the result by date of birth, you will use the following statement:
    SELECT * FROM Customers
    ORDER BY DOB
    As you can see the rows are sorted in ascending order by the DOB column, but what if you want to sort them in descending order? To do that you will have to add the DESC SQL keyword after your SQL ORDER BY clause:
    SELECT * FROM Customers
    ORDER BY DOB DESC
    If you don't specify how to order your rows, alphabetically or reverse, than the result set is ordered alphabetically, hence the following to SQL expressions produce the same result:
    SELECT * FROM Customers
    ORDER BY DOB
    SELECT * FROM Customers
    ORDER BY DOB ASC
    You can sort your result set by more than one column by specifying those columns in the SQL ORDER BY list. The following SQL expression will order by DOB and LastName:
    SELECT * FROM Customers
    ORDER BY DOB, LastName
    if its useful reward points

  • SSRS reporting with sharepoint list using Distinct and Multivalue parameters

    i want create ssrs report with sharepoint list using ms-vs(2008). i want create Distinct multivalue parameters by using CAML query. There is any way we put CAML query where we use Distinct keyword and IN clause in CAML query... i hope all experts will
    understand my poor English... sorry for poor English.. plz help me

    Hi AsifMehmood,
    Per my understanding you have create an SSRS report with SharePoint list, now you don’t know to create the distinct parameters by using CAML query,  right?
    For the CAML language doesn’t have any reserved word (or tag) to set this particular filter to remove duplicate results, but we can use the custom code to do this function. I have tested on my local environment and we can do that by create one hidden parameter(Param1)
    to get all the values from the fields which will  add the filter and then create another parameter(Param2) to get the distinct values based on the Param1, we use the custom code to do the deduplication.
    Step by Steps information in below thread for your reference to create the parameters and the custom code:
    "How to get distinct values of sharepoint column using SSRS"
    Other similar thread for your reference:
    https://audministrator.wordpress.com/2014/02/17/sharepoint-list-add-distinct-parameter-value/
    If your problem still exists, please feel free to ask and also try to provide us more details information.
    Regards
    Vicky Liu

  • Error while using trigger and sequences

    hi friends
    i am leraning oracle now. i have confronted a difficulty while working with triggers and sequence . iF anybody knows this problem ,please help me
    i created atable with the specifications given below
    CREATE TABLE TESTSEQ
    idno NUMERIC(10),
    data1 VARCHAR2(50)
    and i created a sequence named seqcol1
    CREATE SEQUENCE seqcol1
    MINVALUE 1
    MAXVALUE 100
    START WITH 1
    INCREMENT BY 1
    CACHE 20;
    I created a trigger also named
    CREATE OR REPLACE TRIGGER trigADD2
    BEFORE
    INSERT ON TESTSEQ
    FOR EACH ROW
    BEGIN
    SELECT seqcol.NEXTVAL INTO idno;
    END;
    My plan is to add the idno automatically from sequence while inserting a value in data1 column
    while doing insert operation ,
    INSERT INTO TESTSEQ (data1) VALUES ('ram1')
    some error is showing
    the error is SCOTT.trigADD2 is invalid and failed re-validation
    if anybody can help me please help me
    thanks and regards

    ops$oskar@test9i$ create table t (n number, s varchar2(1));
    Table created.
    ops$oskar@test9i$ create sequence s;
    Sequence created.
    ops$oskar@test9i$ insert into t values (s.nextval,'X');
    1 row created.
    ops$oskar@test9i$ insert into t values (s.nextval,'Y');
    1 row created.
    ops$oskar@test9i$ insert into t values (s.nextval,'Z');
    1 row created.
    ops$oskar@test9i$ select * from t;
             N S
             1 X
             2 Y
             3 ZWhat do you need a trigger for?

  • Cm:select - howo to use distinct and such

    Hello:
    I need to do
    SELECT DISTINCT object_name FROM
    content
    How do I do that using cm:select?
    Is there a document anywhere that would explain the cm:select query
    language syntax?
    Any help is appreciated
    Thanks

    Hi Gennadiy,
    Unfortunately, what you want to do cannot be done via the cm:select tag, nor
    any of the standard public APIs. As was mentioned previously, if you were
    using the reference implementation, you could execute a SQL statement
    against the commercePool which looked like:
    SELECT DISTINCT AUTHOR FROM WLCS_DOCUMENT
    or:
    SELECT DISTINCT VALUE FROM WLCS_DOCUMENT_METADATA
    WHERE NAME = 'the name of the property you want'
    With Documentum, that obviously won't work. However, when you setup WLPS
    2.0.1 with Documentum, you configure a JDBC connection pool (dctmPool) that
    utilizes the Documentum JDBC driver. You can execute DQL select statements
    through this. Also, the Documentum Foundation Classes (DFC) are shipped
    with the Documentum WLPS integration piece, so those could be used.
    Questions related to how to use DQL or DFC should be directed to Documentum
    support.
    Regards,
    Ginny Peterson
    BEA Systems, Inc.
    "Gennadiy Civil" <[email protected]> wrote in message
    news:[email protected]...
    Thanks BUT --
    I did read the documentation and there is no way I could find to do what I
    need to do..
    I need to get a list of certain attributes from the content repository,not
    just from the arbitrary database.
    The documents in the repository have certain attributes - for example"autor"
    - so I need to get all the authors the documents have so I can buildbrowse by
    author drop down list.
    cm:select only allows me to get list of documents where for example author
    like "Asimov".
    So hence my question - how do I get a list of all possible non repeated
    authors from the repositiory.
    Thanks
    Gennadiy
    "néné" wrote:
    Hi Gennadiy,
    The <cm:select ...> tag is used to get information from the Content
    Management source.
    You can see the details of this tag at the following documentation URL:
    http://edocs.beasys.com/wlcs/p13ndev/jsptags.htm#1057716
    If you want to get info from the database, and want to use a SQL
    statement
    such as "SELECT DISTINCT object_name FROM ...", you should probably look
    into the <es:preparedstatement ...>
    tag.
    Check the documentation for the <cm:select ...> tag. There just mightbe
    enough info there to help you out!

  • Using DISTINCT and COUNT together.

    So I have a query which I dicovered is not quite working as planned.
    SELECT DISTINCT NULL LINK,
           TO_CHAR(MONTHS_,'YYYY-MM') DATIME,
           sum(decode(CMS.CMS_NODE_OS.OS_TYPE,'Linux','1',0))"Linux" FROM
      ( SELECT ADD_MONTHS(TRUNC(to_date('28-FEB-2013','DD-MON-YYYY'),'MM'),-ROWNUM + 1) MONTHS_ FROM DUAL CONNECT BY LEVEL <=
      (SELECT CEIL( MONTHS_BETWEEN(to_date('28-FEB-2013','DD-MON-YYYY'),TO_DATE('01-FEB-2013','DD-MON-YYYY'))) FROM DUAL) )
    THE_TIMELINE
      LEFT JOIN CMS.CMS_NODE ON ( MONTHS_ BETWEEN CREATE_DT AND LAST_DAY(NVL(RETIRE_DT,MONTHS_)))
      LEFT JOIN CMS.CMS_NODE_OS ON CMS.CMS_NODE.NODE_NAME=CMS.CMS_NODE_OS.NODE_NAME
      WHERE CMS.CMS_NODE.NODE_ENV<>'Alias' and CMS.CMS_NODE_OS.OS_TYPE='Linux' GROUP BY (TO_CHAR(MONTHS_,'YYYY-MM')) ORDER BY DATIMEThe issue that I'm having is that on the LEFT JOIN of the CMS_NODE_OS table that there a mulitple join records. I just want to have one joined. because of the GROUP and SUM the DISTINCT is rendered null and void.(returns 961) when it should be like (737) records.
    How can I just link one CMS_NODE_OS record per CMS_NODE record...

    Hi,
    bostonmacosx wrote:
    ... The issue that I'm having is that on the LEFT JOIN of the CMS_NODE_OS table that there a mulitple join records. I just want to have one joined. because of the GROUP and SUM the DISTINCT is rendered null and void.(returns 961) when it should be like (737) records.That sounds like a Chasm Trap .
    How can I just link one CMS_NODE_OS record per CMS_NODE record...Which one?
    If you can write an ORDER BY clause that would put that row first, then you can use the analytic ROW_NUMBER function. Instead of joining to CMS_NODE_OS, join to a sub-query that has the relevant columns from CMS_NODE_OS, as well as ROW_NUMBER (let's call that column r_num). Include "AND r_num = 1" in the join condition.
    That's just one way to deal with a chasm trap. Depending on your data and your requirements, there may be better ways.
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables involved, and also post the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    Always say which version of Oracle you're using (e.g., 11.2.0.2.0).
    See the forum FAQ {message:id=9360002}
    You'll get better answers faster if you always supply this information whenever you post a question.

  • Using Concat and Distinct together

    hi
    I am using the query below and I am getting 'missing expression' error. How do use Distinct and concat together?
    SELECT 'SELECT ' || DISTINCT COLUMN || ' FROM DUAL UNION ALL '
    FROM TABLE;

    Hi,
    SeshuGiri wrote:
    hi
    I am using the query below and I am getting 'missing expression' error. How do use Distinct and concat together?
    SELECT 'SELECT ' || DISTINCT COLUMN || ' FROM DUAL UNION ALL '
    FROM TABLE;Whenever you have a problem, please post CREATE TABLE and INSERT statments for a little sample data, and the results you want from that data.
    The example you posted has so many mistakes, it's hard to know what you're trying to do.
    COLUMN, DISTINCT and TABLE are all Oracle keywords, and shouldn't be used for actual columnor table names, and using them for aliases is just asking for trouble.
    When using SELECT DISTINCT, the keyword DISTINCT must come immediately after SELECT.
    If you want to assign an alias to a column, it must be at the very end of the expression that defines the column. You can't assign an alias to part of an expression. If you want to do that, use a sub-query.
    Here's a query that uses both SELECT DISTINCT and ||:
    SELECT DISTINCT
            job || deptno    AS jd
    FROM    scott.emp;Edited by: Frank Kulash on May 13, 2011 2:52 PM

  • Problem using secondary database, sequence (and custom tuple binding)

    I get an exception when I try to open a Sequence to a database that has a custom tuple binding and a secondary database. I have a guess what the issue is (below), but it boils down to my custom tuple-binding being invoked when opening the sequence. Here is the exception:
    java.lang.IndexOutOfBoundsException
    at com.sleepycat.bind.tuple.TupleInput.readUnsignedInt(TupleInput.java:4
    14)
    at com.sleepycat.bind.tuple.TupleInput.readInt(TupleInput.java:233)
    at COM.shopsidekick.db.community.Shop_URLTupleBinding.entryToObject(Shop
    _URLTupleBinding.java:72)
    at com.sleepycat.bind.tuple.TupleBinding.entryToObject(TupleBinding.java
    :73)
    at COM.tagster.db.community.SecondaryURLKeyCreator.createSecondaryKey(Se
    condaryURLKeyCreator.java:38)
    at com.sleepycat.je.SecondaryDatabase.updateSecondary(SecondaryDatabase.
    java:546)
    at com.sleepycat.je.SecondaryTrigger.databaseUpdated(SecondaryTrigger.ja
    va:42)
    at com.sleepycat.je.Database.notifyTriggers(Database.java:1343)
    at com.sleepycat.je.Cursor.putInternal(Cursor.java:770)
    at com.sleepycat.je.Cursor.putNoOverwrite(Cursor.java:352)
    at com.sleepycat.je.Sequence.<init>(Sequence.java:139)
    at com.sleepycat.je.Database.openSequence(Database.java:332)
    Here is my code:
    // URL ID DB
    DatabaseConfig urlDBConfig = new DatabaseConfig();
    urlDBConfig.setAllowCreate(true);
    urlDBConfig.setReadOnly(false);
    urlDBConfig.setTransactional(true);
    urlDBConfig.setSortedDuplicates(false); // No sorted duplicates (can't have them with a secondary DB)
    mURLDatabase = mDBEnv.openDatabase(txn, "URLDatabase", urlDBConfig);
    // Reverse URL lookup DB table
    SecondaryConfig secondaryURLDBConfig = new SecondaryConfig();
    secondaryURLDBConfig.setAllowCreate(true);
    secondaryURLDBConfig.setReadOnly(false);
    secondaryURLDBConfig.setTransactional(true);
    TupleBinding urlTupleBinding = DataHelper.instance().createURLTupleBinding();
    SecondaryURLKeyCreator secondaryURLKeyCreator = new SecondaryURLKeyCreator(urlTupleBinding);
    secondaryURLDBConfig.setKeyCreator(secondaryURLKeyCreator);
    mReverseLookpupURLDatabase = mDBEnv.openSecondaryDatabase(txn, "SecondaryURLDatabase", mURLDatabase, secondaryURLDBConfig);
    // Open the URL ID sequence
    SequenceConfig urlIDSequenceConfig = new SequenceConfig();
    urlIDSequenceConfig.setAllowCreate(true);
    urlIDSequenceConfig.setInitialValue(1);
    mURLSequence = mURLDatabase.openSequence(txn, new DatabaseEntry(URLID_SEQUENCE_NAME.getBytes("UTF-8")), urlIDSequenceConfig);
    My secondary key creator class looks like this:
    public class SecondaryURLKeyCreator implements SecondaryKeyCreator {
    // Member variables
    private TupleBinding mTupleBinding; // The tuple binding
    * Constructor.
    public SecondaryURLKeyCreator(TupleBinding iTupleBinding) {
    mTupleBinding = iTupleBinding;
    * Create the secondary key.
    public boolean createSecondaryKey(SecondaryDatabase iSecDB, DatabaseEntry iKeyEntry, DatabaseEntry iDataEntry, DatabaseEntry oResultEntry) {
    try {
    URLData urlData = (URLData)mTupleBinding.entryToObject(iDataEntry);
    String URL = urlData.getURL();
    oResultEntry.setData(URL.getBytes("UTF-8"));
    catch (IOException willNeverOccur) {
    // Success
    return(true);
    I think I understand what is going on, and I only noticed it now because I added more fields to my custom data (and tuple binding):
    com.sleepycat.je.Sequence.java line 139 (version 3.2.44) does this:
    status = cursor.putNoOverwrite(key, makeData());
    makeData creates a byte array of size MAX_DATA_SIZE (50 bytes) -- which has nothing to do with my custom data.
    The trigger causes an call to SecondaryDatable.updateSecondary(...) to the secondary DB.
    updateSecondary calls createSecondaryKey in my SecondaryKeyCreator, which calls entityToObject() in my tuple-binding, which calls TupleInput.readString(), etc to match my custom data. Since what is being read goes for more than the byte array of size 50, I get the exception.
    I didn't notice before because my custom tuple binding used to read fewer that 50 bytes.
    I think the problem is that my tuple binding is being invoked at all at this point -- opening a sequence -- since there is no data on which it can act.

    Hi,
    It looks like you're making a common mistake with sequences which is to store the sequence itself in a database that is also used for application data. The sequence should normally be stored in separate database to prevent configuration conflicts and actual data conflicts between the sequence record and the application records.
    I suggest that you create another database whose only purpose is to hold the sequence record. This database will contain only a single record -- the sequence. If you have more than one sequence, storing all sequences in the same database makes sense and is safe.
    The database used for storing sequences should not normally have any associated secondary databases and should not be configured for duplicates.
    --mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Difference between Oracle 10g and Oracle 11g when using Distinct in SQL

    Hi All,
    When I use Distinct in Oracle 10g, the result would be sorted in ascending order automatically, while there is no sorting in the result set in Oracle 11g.
    I was using plsql developer to run my sql.
    May I know if anyone have the same experience before?
    Is there any kind of setting in 11g that I can make the result in order? Thanks!
    Edited by: user5810051 on 2011/4/6 下午 8:47

    As acadet says, if you want your result ordered you must specify an ORDER BY clause in your query. Just because previous versions of oracle included some ordering as part of the processing of a query, that was not a guaranteed ordering, but just a side-effect. Now that Oracle have improved the internal workings, they've removed the side-effect, and that's why you're not getting the ordering you want, because you were relying on that side-effect rather than explicitly stating the order you wanted.

  • Does anyone know the command and sequence to empty trash using the Terminal utility?

    Does anyone know the command and sequence to empty trash using the Terminal utility?

    Hi d,
    1. Open Terminal (in Applications, Utilities).
    2. Copy and paste the following command into theTerminal window (or type it exactly as follows):
    sudo rm -rf ~/.Trash/*
    3. Press Return.
    4. Type in your password when asked (note: you will not see anything being entered as you type your password).
    5. Hit Return.
    6.Wait until the process finishes/the Terminal prompt returns.
    7. Quit Terminal.

  • Poor performance when Distinct and Order By Used

    Hello,
    I am getting an slow answer when I add Distinct and Order By to the query:
    Without Distinct and Order By lasts 3.57 seconds; without Distinct and Order By lasts 28.15 seconds, which it's too much for our app.
    The query is:
    select distinct CC.acceso, CC.ext_acceso, TIT.TITULO_SALIDA
    from (((Ocurrencias CT01 inner join
    palabras p0 on (CT01.cod_palabra = p0.cod_palabra and p0.palabra like 'VENEZUELA%' AND p0.campo = 'AUTOR')) INNER JOIN
    CENTRAL CC ON (CT01.ACCESO = CC.ACCESO AND CT01.EXT_ACCESO = CC.EXT_ACCESO))) inner join
    codtit ctt on (CC.acceso = ctt.acceso and CC.ext_acceso = ctt.ext_acceso) inner join
    titulos tit on (ctt.cod_titulo = tit.cod_titulo and ctt.portada = '1')
    where CC.nivel_reg <> 's'
    ORDER BY 3 ASC;
    The query plan for the query WITH Distinct and Order By is:
    Elapsed: 00:00:28.15
    Execution Plan
    0 SELECT STATEMENT Optimizer=ALL_ROWS (Cost=301 Card=47 Bytes=12220)
    1 0 SORT (ORDER BY) (Cost=301 Card=47 Bytes=12220)
    2 1 SORT (UNIQUE) (Cost=300 Card=47 Bytes=12220)
    3 2 NESTED LOOPS (Cost=299 Card=47 Bytes=12220)
    4 3 NESTED LOOPS (Cost=250 Card=49 Bytes=4165)
    5 4 NESTED LOOPS (Cost=103 Card=49 Bytes=2989)
    6 5 NESTED LOOPS (Cost=5 Card=49 Bytes=1960)
    7 6 TABLE ACCESS (BY INDEX ROWID) OF 'PALABRAS' (TABLE) (Cost=3 Card=1 Bytes=19)
    8 7 INDEX (RANGE SCAN) OF 'PALABRA' (INDEX (UNIQUE)) (Cost=2 Card=1)
    9 6 INDEX (RANGE SCAN) OF 'PK_OCURRENCIAS' (INDEX (UNIQUE)) (Cost=2 Card=140 Bytes=2940)
    10 5 TABLE ACCESS (BY INDEX ROWID) OF 'CENTRAL' (TABLE) (Cost=2 Card=1 Bytes=21)
    11 10 INDEX (UNIQUE SCAN) OF 'PK_CENTRAL' (INDEX (UNIQUE)) (Cost=1 Card=1)
    12 4 TABLE ACCESS (BY INDEX ROWID) OF 'CODTIT' (TABLE) (Cost=3 Card=1 Bytes=24)
    13 12 INDEX (RANGE SCAN) OF 'PK_CODTIT' (INDEX (UNIQUE)) (Cost=2 Card=1)
    14 3 TABLE ACCESS (BY INDEX ROWID) OF 'TITULOS' (TABLE) (Cost=1 Card=1 Bytes=175)
    15 14 INDEX (UNIQUE SCAN) OF 'PK_TITULOS' (INDEX (UNIQUE)) (Cost=0 Card=1)
    Statistics
    154 recursive calls
    0 db block gets
    32070 consistent gets
    1622 physical reads
    0 redo size
    305785 bytes sent via SQL*Net to client
    2807 bytes received via SQL*Net from client
    212 SQL*Net roundtrips to/from client
    10 sorts (memory)
    0 sorts (disk)
    3149 rows processed
    The query plan for the query WITHOUT Distinct and Order By is:
    Elapsed: 00:00:03.57
    Execution Plan
    0 SELECT STATEMENT Optimizer=ALL_ROWS (Cost=299 Card=47 Bytes=12220)
    1 0 NESTED LOOPS (Cost=299 Card=47 Bytes=12220)
    2 1 NESTED LOOPS (Cost=250 Card=49 Bytes=4165)
    3 2 NESTED LOOPS (Cost=103 Card=49 Bytes=2989)
    4 3 NESTED LOOPS (Cost=5 Card=49 Bytes=1960)
    5 4 TABLE ACCESS (BY INDEX ROWID) OF 'PALABRAS' (TABLE) (Cost=3 Card=1 Bytes=19)
    6 5 INDEX (RANGE SCAN) OF 'PALABRA' (INDEX (UNIQUE)) (Cost=2 Card=1)
    7 4 INDEX (RANGE SCAN) OF 'PK_OCURRENCIAS' (INDEX (UNIQUE)) (Cost=2 Card=140 Bytes=2940)
    8 3 TABLE ACCESS (BY INDEX ROWID) OF 'CENTRAL' (TABLE) (Cost=2 Card=1 Bytes=21)
    9 8 INDEX (UNIQUE SCAN) OF 'PK_CENTRAL' (INDEX (UNIQUE)) (Cost=1 Card=1)
    10 2 TABLE ACCESS (BY INDEX ROWID) OF 'CODTIT' (TABLE) (Cost=3 Card=1 Bytes=24)
    11 10 INDEX (RANGE SCAN) OF 'PK_CODTIT' (INDEX (UNIQUE)) (Cost=2 Card=1)
    12 1 TABLE ACCESS (BY INDEX ROWID) OF 'TITULOS' (TABLE) (Cost=1 Card=1 Bytes=175)
    13 12 INDEX (UNIQUE SCAN) OF 'PK_TITULOS' (INDEX (UNIQUE)) (Cost=0 Card=1)
    Statistics
    3376 recursive calls
    0 db block gets
    33443 consistent gets
    1061 physical reads
    0 redo size
    313751 bytes sent via SQL*Net to client
    2807 bytes received via SQL*Net from client
    422 SQL*Net roundtrips to/from client
    90 sorts (memory)
    0 sorts (disk)
    3149 rows processed
    I would appreciate a lot if somebody can tell me how to improve the performance of the query with Distinct and Order By.
    Thank you very much,
    Icaro Alzuru C.

    Hello,
    I am getting an slow answer when I add Distinct and Order By to the query:
    Without Distinct and Order By lasts 3.57 seconds; without Distinct and Order By lasts 28.15 seconds, which it's too much for our app.
    The query is:
    select distinct CC.acceso, CC.ext_acceso, TIT.TITULO_SALIDA
    from (((Ocurrencias CT01 inner join
    palabras p0 on (CT01.cod_palabra = p0.cod_palabra and p0.palabra like 'VENEZUELA%' AND p0.campo = 'AUTOR')) INNER JOIN
    CENTRAL CC ON (CT01.ACCESO = CC.ACCESO AND CT01.EXT_ACCESO = CC.EXT_ACCESO))) inner join
    codtit ctt on (CC.acceso = ctt.acceso and CC.ext_acceso = ctt.ext_acceso) inner join
    titulos tit on (ctt.cod_titulo = tit.cod_titulo and ctt.portada = '1')
    where CC.nivel_reg <> 's'
    ORDER BY 3 ASC;
    The query plan for the query WITH Distinct and Order By is:
    Elapsed: 00:00:28.15
    Execution Plan
    0 SELECT STATEMENT Optimizer=ALL_ROWS (Cost=301 Card=47 Bytes=12220)
    1 0 SORT (ORDER BY) (Cost=301 Card=47 Bytes=12220)
    2 1 SORT (UNIQUE) (Cost=300 Card=47 Bytes=12220)
    3 2 NESTED LOOPS (Cost=299 Card=47 Bytes=12220)
    4 3 NESTED LOOPS (Cost=250 Card=49 Bytes=4165)
    5 4 NESTED LOOPS (Cost=103 Card=49 Bytes=2989)
    6 5 NESTED LOOPS (Cost=5 Card=49 Bytes=1960)
    7 6 TABLE ACCESS (BY INDEX ROWID) OF 'PALABRAS' (TABLE) (Cost=3 Card=1 Bytes=19)
    8 7 INDEX (RANGE SCAN) OF 'PALABRA' (INDEX (UNIQUE)) (Cost=2 Card=1)
    9 6 INDEX (RANGE SCAN) OF 'PK_OCURRENCIAS' (INDEX (UNIQUE)) (Cost=2 Card=140 Bytes=2940)
    10 5 TABLE ACCESS (BY INDEX ROWID) OF 'CENTRAL' (TABLE) (Cost=2 Card=1 Bytes=21)
    11 10 INDEX (UNIQUE SCAN) OF 'PK_CENTRAL' (INDEX (UNIQUE)) (Cost=1 Card=1)
    12 4 TABLE ACCESS (BY INDEX ROWID) OF 'CODTIT' (TABLE) (Cost=3 Card=1 Bytes=24)
    13 12 INDEX (RANGE SCAN) OF 'PK_CODTIT' (INDEX (UNIQUE)) (Cost=2 Card=1)
    14 3 TABLE ACCESS (BY INDEX ROWID) OF 'TITULOS' (TABLE) (Cost=1 Card=1 Bytes=175)
    15 14 INDEX (UNIQUE SCAN) OF 'PK_TITULOS' (INDEX (UNIQUE)) (Cost=0 Card=1)
    Statistics
    154 recursive calls
    0 db block gets
    32070 consistent gets
    1622 physical reads
    0 redo size
    305785 bytes sent via SQL*Net to client
    2807 bytes received via SQL*Net from client
    212 SQL*Net roundtrips to/from client
    10 sorts (memory)
    0 sorts (disk)
    3149 rows processed
    The query plan for the query WITHOUT Distinct and Order By is:
    Elapsed: 00:00:03.57
    Execution Plan
    0 SELECT STATEMENT Optimizer=ALL_ROWS (Cost=299 Card=47 Bytes=12220)
    1 0 NESTED LOOPS (Cost=299 Card=47 Bytes=12220)
    2 1 NESTED LOOPS (Cost=250 Card=49 Bytes=4165)
    3 2 NESTED LOOPS (Cost=103 Card=49 Bytes=2989)
    4 3 NESTED LOOPS (Cost=5 Card=49 Bytes=1960)
    5 4 TABLE ACCESS (BY INDEX ROWID) OF 'PALABRAS' (TABLE) (Cost=3 Card=1 Bytes=19)
    6 5 INDEX (RANGE SCAN) OF 'PALABRA' (INDEX (UNIQUE)) (Cost=2 Card=1)
    7 4 INDEX (RANGE SCAN) OF 'PK_OCURRENCIAS' (INDEX (UNIQUE)) (Cost=2 Card=140 Bytes=2940)
    8 3 TABLE ACCESS (BY INDEX ROWID) OF 'CENTRAL' (TABLE) (Cost=2 Card=1 Bytes=21)
    9 8 INDEX (UNIQUE SCAN) OF 'PK_CENTRAL' (INDEX (UNIQUE)) (Cost=1 Card=1)
    10 2 TABLE ACCESS (BY INDEX ROWID) OF 'CODTIT' (TABLE) (Cost=3 Card=1 Bytes=24)
    11 10 INDEX (RANGE SCAN) OF 'PK_CODTIT' (INDEX (UNIQUE)) (Cost=2 Card=1)
    12 1 TABLE ACCESS (BY INDEX ROWID) OF 'TITULOS' (TABLE) (Cost=1 Card=1 Bytes=175)
    13 12 INDEX (UNIQUE SCAN) OF 'PK_TITULOS' (INDEX (UNIQUE)) (Cost=0 Card=1)
    Statistics
    3376 recursive calls
    0 db block gets
    33443 consistent gets
    1061 physical reads
    0 redo size
    313751 bytes sent via SQL*Net to client
    2807 bytes received via SQL*Net from client
    422 SQL*Net roundtrips to/from client
    90 sorts (memory)
    0 sorts (disk)
    3149 rows processed
    I would appreciate a lot if somebody can tell me how to improve the performance of the query with Distinct and Order By.
    Thank you very much,
    Icaro Alzuru C.

  • Use of db sequence in a materialized view

    Hi,
    Will it be possible to use a database sequence in a materialized view?
    The materialized view is to return the result set of query that joins multiple tables. One of the columns in the result set - the to-be-created materialized view - is null and requires a sequence.
    Will it be possible to include a db sequence in the query?
    Example:
    create materialized view example_mview
    as
    select example_sequence.nextval, table1.'*', table2.'*'
    from example_table1 table1, example_table2 table2
    where table1.id=table2.id

    What is the purpose of such numbering? To number each row?
    If so - then use ROWNUM as 1st column.
    SQL>with ddd
           as
           (select 333 COL from dual union all select 5444 COL from dual)
           select rownum,COL from ddd;ROWNUM COL
    1 333
    2 5444

  • Error message: The preset used by one or more sequences in this project requires third-party components that could not be located. These sequences will be modified to use a custom sequence setting instead. To continue editing using the original preset, qu

    Hello all,
    I can't open a PP project without this error message appearing:
    "The preset used by one or more sequences in this project requires third-party components that could not be located. These sequences will be modified to use a custom sequence setting instead. To continue editing using the original preset, quit the application without saving the project, reinstall any third-party components that are required and reopen the project".
    What I had been doing before this occurred was editing a PP project using ProRes sequences and multi-camera editing. Multi-camera was not working very well and after a few attempts to fix that I gave up and finished the job cutting 3 layers of video instead. AME refused to render the three finished sequences of over 1hr duration so rendered final videos from the PP sequences.
    I tried deleting plists for AME, PP and QT, repairing disc permissions and rebooting but there was no improvement.
    Client is satisfied for now but will want to come back to this job at a later date so decided to uninstall and re-install AME and PP in the hope both would be ready to work properly when needed again. AME works fine in conjunction with a different PP project but now I can't open the PP project in question without the above error message appearing.
    Having searched the net it would seem that the problem may be caused by ProRes but I haven't been able to find a definitive solution for the problem. Does anyone know either:
    1. How to fix this?
    2. If I chose the "modified using a custom sequence setting", can I be sure that my sequences will look the same even if they don't use ProRes? The final deliverable format will be mp4 so as long as the overall look doesn't change then I can  afford a change in the edit codec. It's just that with three sequences over an hour long, I don't want days of work to be ruined.
    Other older PP projects of mine open and work fine.
    Premiere Pro CC 8.2.0
    Media Encoder CC 8.2.0.54
    OSX 10.10.2
    Any help would be greatly appreciated.
    Duncan.

    Adobe web chat come up with a solution.
    Open the PP project.
    Export your sequence or project as a Final Cut Pro XML file.
    Set up a new PP project.
    Import the Final Cut Pro XML file.
    This will get you back up an running.
    Since getting back to editing this project I have found that some things will be lost or change in using XML:
    You will lose position key framing, black video clips, dissolve fx, audio levels, audio dynamic fx, the ability to open a multi camera clip and change the camera view.
    You will keep cut points, crop fx.
    Not perfect but only took a couple of hours to save 3 days work.

  • How do I use pan and zoom on vertical photographs without editing out most of the photo?

    I am trying to make a slide show.  When I have a vertically oriented (portrait) photograph and try to use pan and zoom, the feature eliminates much of the photograph.  It seems the pan and zoom feature only works for horizontally oriented (or landscape) photographs.  Is there a way to use pan and zoom on vertically oriented photographs to capture all or most of the photograph and zoom in from there?

    gtavetian
    I decided to use a different strategy to convey the principle. It is most likely that your photos will be 4:3 and you may or may not be taking them into a SD widescreen or HD widescreen project. With all those variables, to get the basic ideas across, I am going to use two models with a generalized scheme.
    For this post....
    NTSC DV Standard Project - Portrait Oriented JPG, in this case 2448 x 3264 3:4. Could be any Portrait Oriented JPEG any pixel dimensions. But best plan ahead for what you have and what you would like.
    Manually set the project preset to NTSC DV Standard.
    File Menu/New/Project and, in the new project dialog, set for NTSC DV Standard.
    Before exiting the final dialog in that area, put a check mark next to "Force Selected Project Setting on This Project". Close out of there.
    Next go to the Edit Menu/Preferences/General and remove the check mark next to "Default Scale to Frame Size". Close out of the preferences.
    In the opened Premiere Elements Expert workspace, use Add Media/Files and Folders/Project Assets to get your portrait oriented JPG to the beginning of the Timeline.The 2448 x 3264 3:4 will overwhelm the space in the Edit Mode monitor. That is to be expected. The Timeline Indicator is at the beginning of the Timeline @ 00;00;00;00.
    a. Click on the Timeline jpg to select it. With Motion Panel/Scale property (with Constrain Proportions with check mark), you want to scale the image so that the whole is shown within the mode space. You want to see the image's bounding box. See the next screenshot. The bounding box is the white outline around the image. It has handles.
    After the scaling to get that look, the important information that you want is on the right in the Motion Panel
    Position values 360.0 and 240.0
    Scale value 14.6%.
    The next phase is as before (See post 21 of this thread...but much of that is repeated below and modified for what is being described at this moment)
    With Timeline Indicator at the beginning of Video Track 1 (00;00;00;00), go to Tools Menu/Pan and Zoom and click on it to open  the Pan and Zoom workspace.
    In the Pan and Zoom workspace, you will see that the feature has created the initial two Focus Frames for you. 
    Do not do anything to Focus Frame 1 in the bin below the image window.
    Click on Focus Frame 2 in the bin below the image window and set the Focus Frame as wanted.
    Click on New Frame in the panel to the left of the image window  to create a third Focus Frame which will appear in the bin. Set Focus Frame as wanted.
    Click on New Frame in the panel  to the left of the image window to create a fourth Focus Frame which will appear in the bin. Set the Focus Frame as wanted.
    Click Done to the Pan and Zoom workspace so that you are back in the Premiere Elements Expert workspace with its Timeline.
    In the Expert workspace,
    Move the Timeline Indicator to the last frame of the selected pan and zoom clip 1. In Applied Effects Tab/Applied Effects Palette/Motion Panel expanded, (Toggle Animation should be active at this point), make sure Position settings are 360.0 and 240.0 and Scale = 14.6% (with Constrain Proportions used).Then go to Tools Menu/Freeze Frame and set the freeze frame for 3 seconds and hit Insert in Movie.
    Then move the Timeline Indicator to the first frame of the selected pan and zoom clip 1. In Applied Effects Tab/Applied Effects Palette/Motion Panel expanded (Toggle Animation should be active at this point), make sure Position settings are 360.0 and 240.0 and Scale = 14.6% (with Constrain Proportions used). Then go to Tools Menu/Freeze Frame and set the freeze frame for 3 seconds and hit Insert in Movie.
    Render.
    The Timeline content sequence from start to finish should be:
    Freeze Frame 3 seconds First Frame of pan and zoom clip 1
    Pan and zoom clip 1
    Freeze Frame 3 seconds Last Frame of pan and zoom clip 1
    Freeze Frame 3 seconds First Frame of pan and zoom clip 2
    Pan and zoom clip 2
    Freeze Frame 3 seconds Last Frame of pan and zoom clip 2
    A Dissolve/Cross Dissolve Video Transition (1.00 seconds) is placed between end of Freeze Frame  Last Frame of pan and zoom clip 1 and beginning of Freeze Frame 3 First Frame of pan and zoom clip 2.
    Additional pan and zoom portrait oriented jpgs to the Timeline would be treated as above.
    What was done above can be applied to any photo with any project preset. The basic idea is to
    a. Start with determing the whole picture Position and Scale values as described with the Default Scale to Frame Size option disabled.
    b. Do pan and zoom with Pan and Zoom Tool in its workspace
    c. Return to Premiere Elements workspace to apply your Position and Scale values to the last frame of pan and zoom clip so that the last frame presents in full clip view. Then go to the first frame of the pan and zoom clip, and apply the Position and Scale values to it so that the first frame presents in full clip view.
    d. If you want the whole view to present for more than that one frame, do the freeze frame at each end, with the wanted duration.
    e. Apply emblessments as wanted, such as video transitions, an animated graphic flying through the last scene, etc.
    We could take this same clip into a NTSC AVCHD Full HD 1080p30 project and do the same, except the Position and Scale values and the Scale % determined at the beginning and used subsequently will be different than in the NTSC DV Standard project.
    Please check out the above and see how you do with it. If problems, please indicate where and we will work through them.
    Thanks.
    ATR

  • Deploying the SCCM 2012 Client to WES 7 devices that are locked down with the FBWF using 2007 task sequence via WEDM.

    I'm wondering how people are migrating their embedded devices that are using the FBWF. I've done some googling and it seems like most people are just re-imaging the devices and after migrating a single device i see why. Its not a pretty process. This will
    be a long description but ultimately my question stems more from trying to find a better way to execute the device migration from 2007 to 2012.
    Some back ground on my situation might be in order here. I'm in the process of wrapping up our 2007 to 2012 migration. We have a 2007 infrastructure that was a central server with 2 primaries and 286 secondary site servers. I've consolidated that to a single
    2012 primary site server that hosts all the main roles. There are 2 more servers in the data centers both operating solely as push distribution points I'll refer to them as 2012 01 02 and 03. I'm over half way through the migration and so far haven't needed
    to offload any site roles. There are almost 10,000 clients now reporting to the 2012 site server and almost a 100 field servers pulling content from 2012 02 as their source dp as pull dp is the only way forward for this many devices. I've read the horror stories
    of trying spin up 200 plus push dps. We are running PKI. I'm at the point now where i need to start migrating the Windows Embedded Seven Standard clients that have the 2007 sccm client on them with WEDM for write filter handling.
    What i'm wondering is if anyone has any pointers for me regarding migrating the WES 7 devices. My plan that i've come up with is to somehow script the process using a 2007 WEDM Task Sequence to try and migrate them over to 2012. Things are complicated as
    I need to somehow script the install, the policy checkin, hardware inventory, software inventory, and validate the SCEP client installs before I reboot the device one last time to enable the FBWF. How I handled the SCCM 2007 client install on these devices
    when they were provisioned was to just create a batch file that would sleep for ten minutes then check to see if the inventoryagent.log file had been created yet. I realize now that is inefficient as i can kick off the inventory using a WMI method once the
    client has installed. Also I need to make sure the machine gets its first policy as that is how it creates the communication using PKI through that first policy transfer and that also finalizes the client install. The biggest piece i'm uncertain about in this
    regard is the SCEP client.
    I had to change the SCEP client install from yes to no in the default client settings as we have some Mcaffee servers that can't have the SCEP client on them. I have incremental updates enabled on the collection that has the policy that installs the SCEP
    client but this will take an unknown amount of time unless i force the environment to update as the device starts in 2012 install, or if I could kick off the SCEP isntall... IDK. I'm also wondering if i should keep the device in the migration process until
    i validate it has its proper scep policy applied which I believe can be validated by a registry key somewhere.
    Once the 2012 client gets installed will that cause it to lose its place within the 2007 Task Sequence? Considering its going to take a minimum of 2 reboots I'd normally use the task sequence to handle its progression through the process.
    I'm also considering trying to use an Orchestrator runbook, as that would be a good way to keep track of the migration process as each device migrates. Especially since this might take several seperate scripts.
    I'm going to take a stab at scripting the migration process, but if anyone has any pointers that might make this a less complicated I'd really appreciate it as I've got about 3000 of these devices that need to be migrated over. The other things i've learned
    the hard way is any time you have something this complicated over the course of 3000 devices you will run into unknowns and the failure rate increases. I'm in the precarious position of having to not only build this process out but in some situations have
    it complete in the shortest amount of time possible as we have sites running 24x7. I know the end users behavior all to well and they will just keep hitting the power button sometimes even though their not supposed to so they can get their device functional
    again. In those situations i'd end up, if i'm lucky with a device that no longer has a healthy SCCM client in either environment and the write filter disabled.
    So like i said any pointers anyone could throw my way i'd really appreciate. I manually went through the migration process on a single device for proof of concept and ended up with almost 2 pages of pseudo code for my migration script/scripts.
    Thanks,
    -K.R.

    Hi,
    In R2 there are some new variables you can use to solve this,
    http://ccmexec.com/2014/12/smstsmplistrequesttimeout-value-in-milliseconds/
    In Sp1 though adding a step to sleep for 2-5 minuter after reboot and before the application install step is a common workaround.. a powershell command with "Start-Sleep
    -s 120" should do it. 
    /Jörgen
    -- My System Center blog ccmexec.com -- Twitter
    @ccmexec

Maybe you are looking for

  • Auto-filled fields linked to other selectable fields

    I would like to create a set of numeric fields that auto-fills with default (but user-editable) values, with the selection of a radio button. I would like to be able to create a different set of values for different buttons, all pointing to the same

  • Help activating Photoshop CS Education AGAIN after using AVG Tuneup

    Hi, I have owned and used Photoshop CS Education (yes i know its old) since 2008 on 1 PC and it has worked fine. Last week i installed and ran AVG Internet Securtiy 2013 and their Tuneup Utillities. I completed all the recommended "cleans" and though

  • Pulling a playlist from an IPod

    Okay Guys, here is my little problem. I have playlists I've made for my job, but they were on RealPlayer. There is about 1000 songs divvied between 7 playlists. I got them on the Ipod no problem, and I can update them through Itunes. What I would lik

  • Spyware Problems [I Spy Now]

    My computer told me this spyware called ISpyNow has infected my computer. Since then, I havent been able to use the internet, and it freezes my computer whenever I try to act against it using an Anti-Spyware program. I went into Safe Mode, both norma

  • IPC on iseries

    Hello experts,      i series experts please advise.      Actually our company planing to do IPC(Internet pricing and Configuration) and the IPC consultant is saying we should add additional app server with lot's of memory.  Now we thought we should d