Why am i getting rows which are equal?

Hi All,
  why am I getting the values which are equal(highlighted in bold letters) even though I  have a greater than condition(bold letters) in the where clause of the below query?
     select name1, name2,
       length(ltrim(rtrim(name2))) length_unit,length(ltrim(rtrim(name1))) length_name1 from ucbprem
where ltrim(rtrim(name1)) != ltrim(rtrim(name2))
  and length(ltrim(rtrim(name2))) > length(ltrim(rtrim(name1)))
  and instr(ltrim(rtrim(name2)),' ') !=0
  and substr(ltrim(rtrim(name2)),1,instr(name2,' ')-1) = ltrim(rtrim(name1)) OR substr(ltrim(rtrim(name2)),1,instr(name2,' ')-1) = substr(ltrim(rtrim(name1)),1,2)
order by name1, name2;
name1 name2   length_name2    length_name1
BLDG   BLDG F           6               4
BLDG   BLDG G           6               4
BLDG   BLDG H           6               4
BLDG   BLDG H           6               4
BLDG   BLDG I           6               4
BLDG   BLDG J           6               4
BLDG   BLDG R           6               4
BLDG   BLDG W           6               4
FRNT FR 2 4 4
FRNT FR A 4 4
LOWR LO A 4 4
REAR RE 2 4 4
REAR RE 2 4 4
REAR RE A 4 4
REAR RE B 4 4
REAR RE B 4 4
REAR RE C 4 4
REAR RE D 4 4
UPPR   UP 2M            5               4
Any idea?
Thanks in advance
R.R

OR substr(ltrim(rtrim(name2)),1,instr(name2,' ')-1) = substr(ltrim(rtrim(name1)),1,2)
SQL> conn scott/tiger
Connected.
SQL> create table trimm (name1 varchar2(4), name2 varchar2(4));
Table created.
SQL> insert into trimm values ('FRNT', 'FR 2');
1 row created.
SQL> select * from trimm
  2  where substr(ltrim(rtrim(name2)),1,instr(name2,' ')-1) = substr(ltrim(rtrim(name1)),1,2);
NAME NAME
FRNT FR 2Message was edited by:
stevencallan

Similar Messages

  • Count the rows which are selected ?

    Hi Experts,
    I need help.My requirement is:
    I am having a table which can be multiple selected. But there are two buttons attached to it.Edit and Delete.For Delete I want the Multiple Selection not for EDit.So, If i will click the Edit after multiple selection of the rows.How i can give pop-up that multiple edit is not possible?Means I want to count the rows which are selected how to do that?
    Please guide me.
    Urgent need
    Regards
    Nutan

    Hi Nutan,
    Marcel is right about backend. However I might have an idea once I am developing a quiet similar solution. I would like to ask you to explain with more detail. It seems you have two requirements in one question.
    Regards,
    Gilson

  • I am using my iphone 4s here in dubai.Do i have to install any application to use siri..?? Coz i tried using them and i alwayz get ans which are not relevant.Please advise.

    I am using my iphone 4s here in dubai.Do i have to install any application to use siri..?? Coz i tried using them and i alwayz get ans which are not relevant.Please advise.

    No Siri is preinstalled.  Check you have enabled Siri correctly in Settings>General>Siri>ON and ensure you have completed the My Info correctly.  Siri uses the information in your My Info which is taken from your contact card to respond. Also Siri is still in beta and currently uses limited languages i.e.
    English (United States, United Kingdom, Australia)
    French (France)
    German (Germany)
    Finally just check your restrictions in Settings>General>Restrictions>Siri>ON

  • How to findout rows which are not null ?

    Hi friends,
    Can anyone tell me how to find out the no of rows which is having full data in each column (not null) ?
    Ex:- TEST_TABLE having 1000 columns and lakes of rows.
    myQuestion:- I need to find the no of rows which are filled with 1000 columns filled with not null data.
    Thanks in Advacne.
    Kishore.

    Hello
    You're just going to have to write the query with IS NOT NULL on each column. This will help generate the predicates for the WHERE clause to save quite a bit of typing...
    SELECT
        ' AND '||column_name||' IS NOT NULL'
    FROM
        all_tab_columns
    WHERE
        table_name = 'TEST_TABLE'You can take the output and add that to
    SELECT COUNT(*) FROM test_table WHERE 1=1 HTH
    David

  • I am getting entries which are 'all day' entries duplicated 8 to 9 times. I have updated my software on the phone to the latest version. Entries in iCal are only once.  I have completely emptied my iPhone of all data. Has Apple resolved the issue yet?

    I am getting entries which are 'all day' entries duplicated 8 to 9 times. I have updated my software on the phone to the latest version. Entries in iCal are only once.  I have completely emptied my iPhone of all data. Has Apple resolved the issue yet?

    Simple solution. Get a real internet service and not a cell phone internet connection service it was never meant to be used as the primary internet service
    And how do you lose a home and job and be sued as you claim. What over 10 Gb of data? Give me a break
    In my city small claims is $5000.00
    And over that amount you can go to a superior court to have your issue settled.
    http://www.bbb.org
    Good Luck, Elector

  • How to get services which are running currently

    How to get services which are running currently in the system by a java program. And also how to write a service so that i can start/stop the service from the control panel -> services.

    triple post
    http://forum.java.sun.com/thread.jsp?forum=31&thread=364090&start=0&range=15#1532232
    http://forum.java.sun.com/thread.jsp?forum=31&thread=364088&tstart=0&trange=15

  • How to impdp a specific table excluding rows which are corrupted using impdp

    Hello,
    I need some help with regard to the impdp. I have table which is corrupted and the information of corrupted rows is also available with me now i need to exclude those rows in specific and import the other error free rows.
    Can you please let me know what would be the option to use with impdp.
    Does the QUERY option work with impdp to exclude rows of that particular table.
    Thanks,
    Vinodh

    but import is running for  more than one day but the size of table is huge around 600GB.
    Below you can find the parfile output. How to check if this process is still running. I have used dba_datapump_jobs but no use.
    also truss output says thread is sleeping. Your inputs on this will be much helpful.
    DIRECTORY=DUMPDIR113
    DUMPFILE=expdpA_DDAPTE1_20130403_1003_%U.dmp
    TABLES=A_DDAPTE1.FGBA_JBBB069
    TABLE_EXISTS_ACTION=APPEND
    QUERY=A_DDAPTE1.FGBA_JBBB069:"WHERE RECID NOT IN ('600KR7Feb07-5010009050','FTS100913QA-1','FTS100913QA-11','FTS100913QA-14','FTS100913QA-15','FTS100913QA-16'
    ,'FTS100913QA-17','FTS100913QA-19','FTS100913QA-2','FTS100913QA-25','FTS100913QA-3','FTS100913QA-31','LnLmtTst4Mar06-LMT-1015000','LndPrdMixDec16-4510003850',
    'LndPrdMixDec16-4510004200','LndPrdMixDec30-4400041826','LndPrdMixJan08-1080005191','LndPrdMixJan19-1020043784','LndPrdMixJan24-1300009271','LndPrdMixJan27-20
    80004131','LndPrdMixFeb08-2200008537','LndPrdMixFeb12-2061035772','LndPrdMixFeb23-4010020173','LndPrdMixFeb27-4030043858','LnLmtTst4Mar06-LMT-1015000','LndPdM
    xMr17-1-2040044689','JPMF12309051824404','LndPrdMixMar31-4100030945','LndPrdMixApr26-5020016018','LndPdMxJl09-1-2090030535','JPMJ103090619303826','LndPrdMixSe
    p03-4070048268','LndPrdMixSep24-4400010477','FTS100913QA-14','FTS100913QA-16','FTS100913QA-2','FTS100913QA-17','FTS100913QA-15','FTS100913QA-25','FTS100913QA-
    31','FTS100913QA-11','FTS100913QA-19','FTS100913QA-3','FTS100913QA-1','JPMI22909071376392','LndPrdMixDec16-4510003850','LndPrdMixDec16-4510004200','LndPrdMixD
    ec22-5020009996','LndPdMxJ317-1-2090007173','LndYr2011Jan18-4070033301','LndYr2011Feb02-4400000479','Lndn-11-671BKFeb24-2-1000091345','LndYr2011Mar11-41000182
    11','RPS09090401918928','LndYr2011Feb26-3050008971','LndYr2011Mar214-4400016890','LndYr2011Apr08-4100023458','FTS09091801399914','LndYr2011May26-5010040755','
    LndYr2011Jun01-4030034285','Thrd25BulkJun30-5010048461','CobRun0211Jul08-5020030807','600KCsp511Aug09-4030048518','RlTime250k2Sep09-6010025105','CCS0911060114
    460','3600KR61284NOV24-4030000342','600KR7Feb07-5010009050','FTS09120801346378','600KFWDDATEDMAR09-5010016394','ST10912240129034','MMK0912300369630','600KR701
    MAY04-4100000188','GBA671Tes2RemDor-3000088468','R21210JUL2012R1-3200014672','CBG1002030116505','R312G10OCT2012R3-3070047935','R312G30OCT2012RR1-3090016437','
    SOLARIS07DEC2012RR1-3200011526','LINUX23JAN2013RR1-3020015180','LINUX29JAN2013RR1-3050004304','LINUX04FEB2013RT2-3020045579','MMK10032201164879','FTS100324012
    16453','MMB1003260224532','LINUX14FEB2013RB2-3060003239','LINUX25FEB2013RB1-3100048142','FTS10040802260630','LINUX24MAR2013RB1-4400044062','LINUX23MAY2013RR1-
    3060001245','LINUX10JUN2013RR3-3030035797','LINUX12JUN2013RR2-3060024808','LINUX14JUN2013RR2-3040046259')"
    LOGFILE=YYYY069_20130702LOG.log
    PARALLEL=15
    Thanks,
    Vinodh

  • Does anyone know if I have a pair of unopened dr. Dre beats tour 2.0 but want to exchange for a pair you have to get online that are equal to or less than the value of the beats do I have to pay upfront or can they ship to store and pay at store or exchan

    I bought beats by dre tour earbuds still factory sealed but I want a pair of earbuds can only get online. Will Apple ship to store for me without paying upfront and doing payment when pick up at store

    If you buy something on the Apple online store, then I am sure you realise that you have to pay upfront and it won't let you check out without paying first. 
    Also, I don't think that store delivery is an option - you need to enter a home address for that store and enter valid credit or debit card details to be able to use it and Apple will not ship overseas from any of their stores, so make sure you get the correct store for your country.
    All you can do is purchase what you want and then return the others for a refund.  Either you do this or go directly to the Apple store and see if you can do an exchange there face to face.
    It is the only way as you can't check out of an online store without paying.

  • Placed PNG images which are made in 3ds max are not shown correctly in Ilustrator

    Hello,
    Why placed PNG images (renders) which are made in 3ds max (and then photoshoped) are not shown correctly in Ilustrator. Images appear very noise so you can't see almost a thing. the same pictures (renders) made in Revit appear ok.
    Is there a solution to solve this issue?
    Thanks.

    You would have to provide screenshots of how it looks in PS, including the channels visible. MAX may have embedded extra channels that throw off AI. And of course check whether your PNG is actually 8bit, not 16bit.
    Mylenium

  • The Refiner Result type: When refine by result type: PDF or Zip sometimes files which are images are shown (not pdf or zip)

    Hi,
    We use Search Refiners and there is a strange problem: when we refine by the Refiner Result type: Zip and PDF we also get files which are gif files.
    keren tsur

    Hi,
    According to your post, my understanding is that you get the gif files sometimes when you refiner the Result Type PDF or ZIP.
    I try to do this test in my environment, however, the result is I get the corresponding PDF file and don’t get the gif files by Refiner the PDF Result Type in Search Center.
    Do you get all gif files by the Refiner Result Type: PDF or ZIP in Search Center?
    And, do you see these gif files under the Refiner Result Type: Image?
    I recommend that you can try to respectively type the “PDF”, “ZIP” and “gif” in search box to compare the search results.
    Also, you can try to go to SharePoint 2013 Central Administration, click “Search Service Application” in “Manage service application”, click the “Index Reset” to reset all crawled content, then start Full Crawl again.
    Best Regards,
    Yumi Fu

  • Why should i get an apple tv?

    What does an apple Tv do? why should i get one? are they any good? how do you use them?

    Any good?  Im a grumpy "doesn't like anything person"   AppleTV is far and above worth the $100 cost of same.
    Tons of free content. You can wifi beam your screen to your TV via the AppleTV,  beam movies, youtube content on the screen.
    AppleTV doesnt even have a bottom, plug it into the wall, plug HDMI cable from IT to your Tv set.....
    3 mins to set it up with remote and then its all cruising from there.
    If you get one, youll only be upset that you didnt buy one earlier.

  • TS1717 This article is vague and unhelpful. My iTunes needs help from a pro. I have over 120,000 songs -- NO movies, TV, radio, or books... I have other programs which efficiently run things which are not audio-based. So why can I not get iTunes working w

    This article is vague and unhelpful. My iTunes needs help from a pro.
    I have over 120,000 songs -- NO movies, TV, radio, or books...
    I have other programs which efficiently run things which are not audio-based.
    So why can I not get iTunes working well?? It now takes at least 10 secs for any operation to be completed!
    That is just plain evil. But I am sure I could do something to help.
    All the music is on an 2T external drive.

    TS1717 as noted in the thread title...
    Brigancook, is the library database on the external or just the media? iTunes reevaluates smart playlists and rewrites its database after every action on the library. I've found this can make a library half that size, with a lot of smart playlists, quite sluggish. That said I'm aware part of my problem is aging hardware. Having the database on the internal drive may improve performance if it is currently on the external.
    I'd expect to see an exponential relationship between size and response time which may explain what you see. Cutting down on the number of smart playlists might help. If we're really lucky the long awaited iTunes 11 might have streamlined some of the background processes as well as cleaning up the front end.
    tt2

  • Why i am not able to get all the applets which are included in a page

    Hi All,
    I have two applet which are included in JSF pages, when try to print all the applets which are inculded in web page
    Using below code. but it is printing current applet(the applet which is using this code to print),
    i am not seeing the other applet in println statement.
    what could be reason (well when i made a demo example it is printing all the applets which are included in web page)
    and is there any permission issues ( both applet are signed as well).
    can you please what could be the reason, thanks in advance.
    Enumeration enumw =   getAppletContext().getApplets();
                    while (enumw.hasMoreElements()) {
                        Applet element = (Applet)enumw.nextElement();
                        System.out.println("-------------applet name -------------------------------------->"+element.getName());
    }

    HI AndrewThompson64,
    thanks for your replay, i have increased dukes,
    one more thing i have tried is applet to javascript and from javascript to applet communication,
    but still i am not able to get other applet, when i tried call a javascript method i.e. doAlert(s) it calls, but i tried to print
    the other applet but it is not displaying it. the following code i have tried.
    <SCRIPT>
            function doAlert(s) {
                 alert(s);
                 alert(document.FloorPlanView);
                 alert("FloorPlanView "+document.applets["FloorPlanView"]);
                 alert("0 "+document.applets[0]);
                 alert("1 "+document.applets[1]);
                 alert("ScheduleProfileApplet "+document.ScheduleProfileApplet);
            </SCRIPT>let me tell you how the applet included in the webpage.
    mainmodule which include two jsp pages jsppage1.jsp and jsppage2.jsp
    and in jsppage1.jsp which includes a JSF page and it contains Applet
    <jsp:include page="ScheduleModule.jsp"/>and similarly same for the second applet.
    I need to look at applet communication through socket programing
    any help will be appreciated.

  • Why java file name and class name are equal

    could u explain why java file name and class name are equal in java

    The relevant section of the JLS (?7.6):
    When packages are stored in a file system (?7.2.1), the host system may choose to enforce the restriction that it is a compile-time error if a type is not found in a file under a name composed of the type name plus an extension (such as .java or .jav) if either of the following is true:
    * The type is referred to by code in other compilation units of the package in which the type is declared.
    * The type is declared public (and therefore is potentially accessible from code in other packages).
    This restriction implies that there must be at most one such type per compilation unit. This restriction makes it easy for a compiler for the Java programming language or an implementation of the Java virtual machine to find a named class within a package; for example, the source code for a public type wet.sprocket.Toad would be found in a file Toad.java in the directory wet/sprocket, and the corresponding object code would be found in the file Toad.class in the same directory.
    When packages are stored in a database (?7.2.2), the host system must not impose such restrictions. In practice, many programmers choose to put each class or interface type in its own compilation unit, whether or not it is public or is referred to by code in other compilation units.

  • I'm in India and use Indian iTune store. But there are certain books which are not avaiable in Indian store but are there in US store. How can i get those books?

    I'm in India and use Indian iTune store. But there are certain books which are not avaiable in Indian store but are there in US store. How can i get those books?

    Hi Jai Shree Hari,
    Yeah, I don't see why you shouldn't be able to sign your friend's iTunes sign-on into iTunes, and then use that to download the books. You may need to also authorize your computer in iTunes with that ID in order to be able to re-download them to your device if you ever need to (not sure if this is absolutely required since most things live in the cloud now, but better to be safe than sorry.... ).
    Best of luck!
    Cheers,
    GB

Maybe you are looking for

  • Screen/movie capture apps for qt movies or flash 8 video player

    was helped with this by J walker. i am trying to view the code in firefox or safari from this video http://www.planetphotoshop.com/videos/flash_depthoffield.html but do not see a url with mov is this downloadable besides snapz pro is there a free app

  • How does tagging work?

    I see there is a show by tags feature in the ios app. How does tagging work?

  • Auto populate MSRP into Revenue Purchase Price

    I am using Product Revenue related list on Opportunity. Each Product record has an MSRP value. When a new Product Revenue record is added, the user must select a product. Is there a way to copy the MSRP from the selected record into the Product Price

  • Corruption of Photo files

    I have recently updated my iphoto6 and imported a few pictures from my Canon Rebel X. After doing so i discovered that iPhoto would open, but then freeze and not respond. Reading a variety of forums it would appear that this is because i have corrupt

  • Experts

    Sorry for my english. In BPM how to say if a receive step is not receiving in a period of time then just go onto to next step. So I sending message and after my send I have receive step and i am not receiving the message after my send by maybe 1 min