Any difference between this two sql

are there any difference between this two sql
-- table definition : create table test(col varchar2(20) not null)
select * from test where col like '%%'
--and
select * from test
any difference there? please give some detailed analysis. thx.

Also take care when there are indexes.
SQL> create unique index testtab_col on testtab( col );
Index created.
SQL> set autotrace on explain                                            
SQL> select * from testtab;
COL
col1                         
col2
Execution Plan
Plan hash value: 2692415588
| Id  | Operation         | Name    | Rows  | Bytes | Cost (%CPU)| Time     |
|   0 | SELECT STATEMENT  |         |     3 |    21 |     3   (0)| 00:00:01 |
|   1 |  TABLE ACCESS FULL| TESTTAB |     3 |    21 |     3   (0)| 00:00:01 |
Note
   - dynamic sampling used for this statement
SQL> select * from testtab where col like '%%';
COL
col1
col2
Execution Plan
Plan hash value: 2166828774
| Id  | Operation        | Name        | Rows  | Bytes | Cost (%CPU)| Time     |
|   0 | SELECT STATEMENT |             |     2 |    14 |     1   (0)| 00:00:01 |
|*  1 |  INDEX FULL SCAN | TESTTAB_COL |     2 |    14 |     1   (0)| 00:00:01 |
Predicate Information (identified by operation id):
   1 - filter("COL" LIKE '%%')
Note
   - dynamic sampling used for this statement
SQL>So no - bottom line is that these SQLs are different. They may look superficially the same and even under certain circumstances act the same. But they are not the same.

Similar Messages

  • What are the differences between this two statements???

    1.select * from counter where eboxid = (select acctid from zsyy_ocecs.cm_subs_subscriber where servnumber = ?);
    2.select b.* from zsyy_ocecs.CM_SUBS_SUBSCRIBER a,COUNTER b where a.acctid = b.eboxid and a.servnumber = ?;
    what are the differences between the 2 sql statements??
    I WILL APPRECIATE FOR YOUR ANSWERS VERY MUCH, BECAUSE I WAS PUZZLED WHEN I SAW THE EXECUTION PLANS.THANKS AGAIN. MR SHI.
    the followings are their execute plans:
    Command> select * from counter where eboxid = (select acctid from zsyy_ocecs.cm_subs_subscriber where servnumber = ?);
    Query Optimizer Plan:
    STEP: 1
    LEVEL: 2
    OPERATION: TblLkTtreeScan
    TBLNAME: ZSYY_OCECS.CM_SUBS_SUBSCRIBER
    IXNAME: IDX_SERVNUM
    INDEXED CONDITION: CM_SUBS_SUBSCRIBER.SERVNUMBER = qmark_1
    NOT INDEXED: ROWNUM < 3
    STEP: 2
    LEVEL: 2
    OPERATION: RowLkTtreeScan
    TBLNAME: COUNTER
    IXNAME: IDX_COUNTER
    INDEXED CONDITION:
    COUNTER.EBOXID = CM_SUBS_SUBSCRIBER.ACCTID
    NOT INDEXED: <NULL>
    STEP: 3
    LEVEL: 1
    OPERATION: NestedLoop
    TBLNAME: <NULL>
    IXNAME: <NULL>
    INDEXED CONDITION: <NULL>
    NOT INDEXED: <NULL>
    Command> select b.* from zsyy_ocecs.CM_SUBS_SUBSCRIBER a,COUNTER b where a.acctid = b.eboxid and a.servnumber = ?;
    Query Optimizer Plan:
    STEP: 1
    LEVEL: 2
    OPERATION: TmpTtreeScan
    TBLNAME: ZSYY_OCECS.CM_SUBS_SUBSCRIBER
    IXNAME: <NULL>
    INDEXED CONDITION: <NULL>
    NOT INDEXED: A.SERVNUMBER = qmark_1
    STEP: 2
    LEVEL: 2
    OPERATION: TblLkTtreeScan
    TBLNAME: COUNTER
    IXNAME: IDX_COUNTER
    INDEXED CONDITION: B.EBOXID
    = A.ACCTIDNOT INDEXED: <NULL>
    STEP: 3
    LEVEL: 1
    OPERATION: MergeJoin
    TBLNAME: <NULL>
    IXNAME: <NULL>
    INDEXED CONDITION: A.ACCTID = B.EBOXID
    NOT INDEXED: <NULL>
    Edited by: user9533799 on 2008-9-3 上午1:28

    If zsyy_ocecs.cm_subs_subscriber table returns one row for each servnumber, both statements would return the same data. But if there was a servnumber value on two rows, the first statement will throw an error (you a comparing a value with a set of values). You can rewrite the first query to avoid this:
    select * from counter where eboxid in (select acctid from zsyy_ocecs.cm_subs_subscriber where servnumber = ?);
    Conceptually they are different and the execution plan can't be the same.

  • Are there any differences between these two kinds of constructor

    one pass x a value in a method;
    another not;
    are there any differences when using them?
    ===========
    class ConstructorA
         int x=1,z;
         public ConstructorA(int a){
              z=a;          
    class ConstructorB
         int x,z;
         public ConstructorA(int a){
              x=1;
              z=a;          
    }

    Well the problems would arrive when you add other constructors:
    - if the default value for x is really 1, whatever the way the object is initialized, then it's better to declare it in x's declaration. Otherwise if someone adds to this class a constructor that forgets to set x=1, x's value will remain 0 and bugs may occur.
    - if the default value for x depends on the way it is initialized, then on the contrary it's better to initialize it explicitly in the constructors, and not in x's declaration so as not to have several constructors with inconsistent code.

  • Is there any difference between this final 2.7 and the 2.7 "candidate"

    that I downloaded a couple of weeks back and am now using.
    When I tell the program to check for an update it shows nothing new.
    In other words...should I download again or did the candidate become the final?

    The 2.7 RC is the same as the final, so no need to update if you already have the 2.7 RC installed.

  • Is there any difference between the MAM30 files @service market place

    Hi All,
    I can able to see MAM30 files at two places in service.sap.com. I would like to know is there any difference between this two.
    Any information would be highly appreciated.
    1.http://service.sap.com/swdc
    SAP Support Packages
    Entry by Application Group
    SAP xApps
    SAP xApps for Mobile Business
    SAP MAM
    SAP XMAM 3.0 (ON NW04S)
    XMAM 3.0
    OS independent
    i.  MAMLAPTOP3005_0-20001490.ZIP SAP MOBILE ASSET MANAGEMENT 3.0 SP05 (Laptop)  0 Info 34253 24.01.2008
    and another one is at
    2.http://service.sap.com/swdc ->
    Download ->
    Installation and upgrades ->
    Entry by Application Group ->
    SAP xApps ->
    SAP xApps for Mobile Business ->
    SAP xMAM -> SAP xMAM 3.0 -> SAP XMAM 3.0 (ON NW04S)->Installation.
    i. ZIP 51033399 SAP XMAM 3.0 NW2004s/NW04 SP05 Laptop  Info 28555 20.02.2008
    ii.  ZIP 51033400 SAP XMAM 3.0 NW2004s/NW04 SP05 PDA  Info 18546 20.02.2008
    Regards,
    Ameer.

    Hi Scott,
    Mobile Client version does not depend on application version (Laptop versus PDA).
    MI client version depends on a device you plan to use. If you plan to runmobile app on a Win32 type device (desktop, laptop, tablet) you need an appropriate MI clien as opposed to Windows Mobile OS device (like PDA).
    As for MAM version: in MAM 3.0 there are two versions, laptop and PDA. They reuse common processes but UI is very diferent and not only in a sense that laptop has more information per screen. They use different UI libraries, look and feel is very different and enhacements are done differently.
    MAM 3.0 PDA version will run on any OS device (laptop AND PDA).
    MAM 3.0 Laptop version will only run on Win32 based device (laptop).
    So if your customer wants to use same app on both laptop and PDA - you should consider using PDA version only.
    Best regards,
    Larissa

  • Any difference between distinct and aggregate function in sql query cost???

    Hi,
    I have executed many sql stmts patterns- such as:
    a) using a single table
    b) using two tables, using simple joins or outer joins
    but i have not noticed any difference in sql stmts in cost and in execution plan....
    Anyway, my colleague insists on that using aggregate function is less costly compared to
    distinct....(something i have not confirmed, that's why i beleive that they are exactly the same...)
    For the above reffered 1st sql pattern.. we could for example use
    select distinct deptno
    from emp
    select count(*), deptno
    from emp
    group by deptno select distinct owner, object_type from all_objects
    select count(*), owner, object_type from all_objects
    group by owner, object_typeHave you found any difference between the two ever...????
    Note: I use Ora DB 10g v2.
    Thank you,
    Sim

    distinct and aggregate function are for different uses and may give same result but if u r using aggregate function to get distinct records, it will be expensive...
    ex
    select distinct deptno from scott.dept;
    Statistics
    0 recursive calls
    0 db block gets
    2 consistent gets
    0 physical reads
    0 redo size
    584 bytes sent via SQL*Net to client
    488 bytes received via SQL*Net from client
    2 SQL*Net roundtrips to/from client
    0 sorts (memory)
    0 sorts (disk)
    4 rows processed
    select deptno from scott.emp group by deptno;
    Statistics
    307 recursive calls
    0 db block gets
    60 consistent gets
    6 physical reads
    0 redo size
    576 bytes sent via SQL*Net to client
    488 bytes received via SQL*Net from client
    2 SQL*Net roundtrips to/from client
    6 sorts (memory)
    0 sorts (disk)
    3 rows processed
    Nimish Garg
    Software Developer
    *(Oracle & ASP.NET)*
    Indiamart Intermesh Limited, Noida
    To Get Free Oracle & ASP.NET Code Snippets
    Follow: http://nimishgarg.blogspot.com

  • Any differences between inner join and join without any keyword(inner join)

    Are there any differences between following two join statements?
    Join Statement 1:
    select column1, column2 from table1 t1, table2 t2 where t1.t1Key=t2.t2Key;
    Join Statement 2:
    select column1, column2 from table1 t1 inner join table2 t2 on t1.t1Key = t2.t2Key;
    Thanks for your reply.
    Kevin

    Hi, Kevin,
    user13531850 wrote:
    Are there any differences between following two join statements?To the system, those two are equivalent. They will produce exactly the same results, and will probably result in the same execution plan, so they will be equally efficient.
    Some people find it easier to read and understand one rather than the other. Personally, I find the ANSI syntax (JOIN ... ON ...) easier to understand. The join conditions that apply to each table are listed right next to the table; you don't have to hunt through a long WHERE clause to find them. Also, it makes debugging easier. If you forget the join condition, then you get a syntax error, pinpointing where you forgot the join condition. Using the old syntax, if you forget a join condition, you get a cross-join, and it may not be obvious that any error occurred, but even if you do notice the mistake, you have no clue where it happened.
    Join Statement 1:
    select column1, column2 from table1 t1, table2 t2 where t1.t1Key=t2.t2Key;This is the old join syntax. It works in all versions of Oracle (so far).
    Join Statement 2:
    select column1, column2 from table1 t1 inner join table2 t2 on t1.t1Key = t2.t2Key;This is the ANSI join syntax. It works in Oracle 9.1 and higher. The keyword INNER is optional.

  • Are there any difference between iPhone 4S and iPhone 5? What are they?

    What I already know is that iPhone 5 has a larger screen and is slimmer, but are there any difference between the two.  I have iPhone 4S now, should I buy iPhone 5?

    There are a number of major differences between iPhone 4S and iPhone 5, the major one being the processor speed.  iPhone 5 has a much faster processor – two times faster than the processor in iPhone 4S.  This difference is only significant if you use your phone to play high graphics games that require a lot of processing power.  This processing speed also makes the applications load and run faster – iPhone 5 even boots in a shorter time than iPhone 4S.  You can use iPhone 4S comfortably now but when games and graphic apps designed for iPhone 5 are released, you may be forced to upgrade your phone to run the smoothly.

  • Any difference between new and old wireless Mighty Mouse?

    Hello,
    I got an "old" wireless Mighty Mouse (the one with the grey side buttons) from my father. Now I am wondering if there is any difference between this mouse and the new one, besides the color change of the side buttons. I checked my mouse against the tech specs on the Apple Mighty Mouse site, and they seem to be absolutely identical, but still, I would like to hear this from an expert, which I hope to find here . Also, does anyone know where to find the user’s guide for the wireless mouse online? I have been searching the whole Apple site, but found it nowhere.
    Thanks in advance for your answers.

    Hi,
    This question is already discussed in sdn earlier.
    The follwoing thread give u complete details abt new GL & old GL :
    Re: Old & New GL, Balance Sheet and P&L Reports
    Regards
    Ram.

  • Any performance difference between these two 6600gt agp cards?

    Is there any performance or spec differences between the two 6600GT AGP cards: NX6600GT-VTD128 and  NX6600GT-VTD128SP ?
    Only difference I see is one comes with Riddick and one with XIII. If there's no difference, which game is better? :p
    Also are there any big known bugs with this card? I'm currently running an AMD XP2800 on a MSI K7N2 mobo.

    Pipo,
    The difference is in the Memory Speed. 900Mhz vs 1000Mhz on the SP.
    Take Care,
    Richard

  • Can't see any difference between two code examples

    Hi,
    I wonder, what is the difference between these two code examples?
    In my eyes they do the same thing, or?
    protected void processWindowEvent(WindowEvent e) {
    if (e.getID() == WindowEvent.WINDOW_CLOSING) {
    dispose();
    super.processWindowEvent(e);
    public void actionPerformed(ActionEvent e) {
    if (e.getSource() == button1) {
    dispose();
    /A

    Where did you learn Swedish? You wrote it right but this sentence: "Mig sj�lv, jag kommer fr�n....." is not quite right. You have to write it like this: "Sj�lv s� kommer jag fr�n ...." or "Jag kommer fr�n....".
    When I wrote "or" before, I meant or like in "right or wrong" not like in "eller hur".
    I'm born in Poland but i moved to Sweden when I was 6,5 years old.
    I have one more question about the window-closing-thing:
    In an other file it looks like this:
    private class SymWindow extends java.awt.event.WindowAdapter
              public SymWindow(){}
                        public void windowClosing(java.awt.event.WindowEvent event)
    jMenuFileExit_actionPerformed();
    ////////this comes after that one above//////////
    protected void processWindowEvent(WindowEvent e) {
    super.processWindowEvent(e);
    if (e.getID() == WindowEvent.WINDOW_CLOSING){
    jMenuFileExit_actionPerformed();
    In this file you can choose to exit the program by choosing exit from a menu or just click in the upper right corner (the cross). If you have a file open, don't save it and want to exit, a message will appear with a question if you want to save. This worked fine from the beginning but to this message I added a cancel button (before it was only yes and no). This didn't work. I took away the second code example and and added this: "setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE)" to the first one and everything works fine. The three buttons work if I choose exit from the menu or if I click the cross. Is it right?
    By the way, thanks for your help
    /A

  • Is there any difference between DDR3 memory and LPDDR3 memory? As i brought my macbook air 2013 recently and i saw the specifications it is indicating DDR3, buy apple website stated LPDDR3. Anyone can advise on this?

    Hi
    Is there any difference between DDR3 memory and LPDDR3 memory? As i brought my macbook air 2013 recently and i saw the specifications in the system info that is indicating DDR3, but apple website stated LPDDR3. Anyone can advise on this?

    Welcome to Apple Support Communities
    Read > http://en.wikipedia.org/wiki/Mobile_DDR DDR is the RAM used in computers, and LPDDR is common in mobile computers

  • HT1604 Is there any difference between Mac OS Extended Format and ExFat?

    Is there any difference between Mac OS Extended Format and ExFat?  I read in a blog that the ExFat was a good way to format an external drive because it avoided many of the pitfalls of the other formats, as long as it is supported by the operating system.  I tried to format my new Seagate drive, and got an invalid option error.  I was able to format it in Mac OS Extended format.  Can you please tell me if this is similar to ExFat.  Thanks.

    The Mac OS format can only be natively read to and written to by a computer running the Mac OS. This creates a problem if the user wishes his external, or other drive to have seamless compatibility between two different OS's, such as Windows and Mac. Yes, there are software solutions that enable a Windows PC to work with a drive formatted as Mac OS, but it gets complicated if you wish that drive to have compatibility "on the fly" with any PC you may encounter.
    It turns out that the format known as ExFAT is able to be natively read by both a Mac and a PC, without running any additional drivers on either machine. ExFAT also doesn't have some of the limitations of FAT32, which both OS's will also read/write.
    ExFAt is not perfect though. Formatting the drive as Mac OS Extended has some advantages on a Mac. First, it is the only format that permits all functionality of the Mac OS, such as using the drive for Time Machine.
    ExFAt is often thought of as the best middleground for an external partition/drive that needs to have easy cross platform compatibility between a Mac and  PC running Vista or Windows 7.

  • Is there any difference between the digital connection cables?

    Is there any difference between digital connection cables that connect to the back of a computer?  I've seen some with two groups of nine pins and a blade.  I've seen some with a solid group of 27 pins.  I've seen the blade pin and the four pin.  I currently run one that has two groups of nine pins with a blade pin.  I use it for DVI and it does ok.  I wanted to look into the HDMI cable and see how or if things would be different.  I bought a cable that has the 27 pin connector with a blade.  It physically connects but there is no signal.  I checked the monitor and I set it first to HDMI and then tried AUTO.  It made no difference.  I powered it all down and restarted it all and there was no difference.  Do I need to keep looking for a cable that has the same design connection to the PC but has the HDMI connection on the other end.  I may have this info wrong.  I just know I have two large connections at the time but the last cable I tried had one large connector and one that looked like an advanced USB design.  And then is there really any gain between the two as far as video quality or response?

    There are several type of connectors/cables with different effect.
    VGA
    DVI
    HDMI
    To understand more, I would say please look it up.
    Wish you luck,
    Karthik
    --Say "Thanks" by clicking the Kudos (purple thumbs up icon in the lower right corner of a post)
    --Please mark the post that solves your problem as "Accepted Solution"

  • Is there any difference between iMacs with Core i5 that come with Lion factory installed or not?

    I bought two Imacs (2.5GHz Intel Core i5) recently, and asked for the latest model carrying Core i5. One came with Lion installed, and now that I unpack the second one, it has Mac OS X 10.6.7 installed. I want to make a complaint, but I don't know if I should only ask the dealer to install Lion on the machine, or to change the machine. Someone can tell me if there's any difference between the pre-customary-Lion installation models and previous ones? Is there any way to know certainly that two machines are exactly the same? Please, help.

    I want to make a complaint
    I wouldn't complain, I would be happy. Macs capable of running Snow Leopard are more valuable.
    Your Snow Leopard Macintosh can always be upgraded to Lion later.  But many who have Lion want Snow Leopard, but this can be difficult.
    You have the best of both worlds.
    Just search this forum (or the Internet) for:  Downgrade Lion to Snow Leopard.

Maybe you are looking for

  • Limitations of read-only JE Environments

    Hello all, I realized recently that our documentation on the limitations of read-only Environments is lacking. So for the next JE release I updated the javadoc for EnvironmentConfig.setReadOnly. The new text is pasted below. If you're using, or think

  • Iphone turns on and turns off

    i turn on m iphone 2g it is starting up then when it should let me slide to unlock it goes black (turns off) what should i do.

  • Excise - Balance qty, showing wrong in RG 23 D and in J1iJ

    Hi: We have  issue  with respect to the Excise records inventory movement. and this started happening for no reason in last month. The balance of inventory in the Excise records is not getting exhausted as and when invoicing is done. For example: If

  • Can anyone help with uploading photos from iPad to Facebook.  Thanks

    Can anyone help with uploading photos fom iPad to Facebook?  Thanks

  • Taxes PO Printing

    Hi, I am facing a problem while printing PO 1) I am entering taxes like Excise,VAT,CST,Cess etc    I want that taxes to be printed in PO 2) If multiple line items with diffrent tax conditions are there how can I print that in PO 3) How to treat diffr