DBAsupport.com Forums - Powered by vBulletin
Results 1 to 7 of 7

Thread: searching fullname

  1. #1
    Join Date
    May 2005
    Location
    Boracay
    Posts
    681

    searching fullname

    Hi Dearest Friends,

    I have an EMP table with column FULLNAME with sample:

    FULLNAME
    ----------
    DAVID ALRIDGE
    ALRIDGE DAVID
    DAVID ALRIDGE WRIGHT
    DAVID WRIGHT ALRIDGE
    LEDAVIDE CALRIDGER

    Input data for search : DAVID ALRIDGE

    I want to make a query for search such that all rows in the table are valid hit except LEDAVIDE CALRIDGEAR.

    Its like this:

    SELECT FULLNAME FROM EMP WHERE FULLNAME LIKE 'DAVID % ALRIDGE %'
    OR FULLNAME LIKE 'ALRIDGE % DAVID %';

    But I can not satisfy all conditions :(

    Pls help.

    Thanks
    Last edited by yxez; 11-01-2007 at 09:38 AM.
    Behind The Success And Failure Of A Man Is A Woman

  2. #2
    Join Date
    Mar 2007
    Location
    Ft. Lauderdale, FL
    Posts
    3,555
    if your solution doesn't work yet you have to keep thinking.
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.

  3. #3
    Join Date
    May 2005
    Location
    Boracay
    Posts
    681
    I did Pavd ....actually its over a week now that I am puzzled by It.
    Can u help please....
    Behind The Success And Failure Of A Man Is A Woman

  4. #4
    Join Date
    Mar 2007
    Location
    Ft. Lauderdale, FL
    Posts
    3,555
    Here is a hint...
    Code:
    Select  Fullname 
    From    Emp 
    Where   Fullname Like '%DAVID%'
        And Fullname Like '%ALRIDGE%'
    ;
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.

  5. #5
    Join Date
    Jan 2001
    Posts
    2,828
    Hi

    I wish PAVB was my teacher who sets my term papers with genorous dose of hints :-)

    regards
    Hrishy

  6. #6
    Join Date
    May 2005
    Location
    Boracay
    Posts
    681
    Quote Originally Posted by PAVB
    Here is a hint...
    Code:
    Select  Fullname 
    From    Emp 
    Where   Fullname Like '%DAVID%'
        And Fullname Like '%ALRIDGE%'
    ;
    But I must use the fullname index bacause it contains millions of rows dear
    Behind The Success And Failure Of A Man Is A Woman

  7. #7
    Join Date
    Mar 2007
    Location
    Ft. Lauderdale, FL
    Posts
    3,555
    EMP table as in EMPloyee table with millions of rows?
    Don't worry, I really don't want to know.

    On the other hand, as I said that was a "hint" not a solution; I'm pretty sure ontime you will be able to elaborate on it.
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width