selecting a converted string?

Discussion in 'Databases' started by mahmood, Apr 9, 2006.

  1. #1
    Say I have a function that converts a string like "mike & toni" to "mike and toni" ie if it finds "&", it would replace it with "and", other wise returns the same string.

    Now I have no way to realize that it was "mike & toni" or "mike and toni" in the first place. - And I mention that the real conversion is far more complex and not reversable like this one -

    Having "mike and toni" I want to search the database for its ocourence. The best way is that I query the database for all data that would have been converted to "mike and toni".

    Lets say I call the function "convertIt", This is the seudocode

    select * from myTable where covertIt(`columnName`) equals "mike and toni"[/PHP\]
    
    Well, I tried above and it returns error.
    
    How would you do that?
    
    One possibility is that I select everything convert them using my "convertIt" function and compare them to "mike and toni", but takes a lot of time
    PHP:
     
    mahmood, Apr 9, 2006 IP
  2. donteatchicken

    donteatchicken Well-Known Member

    Messages:
    432
    Likes Received:
    28
    Best Answers:
    0
    Trophy Points:
    118
    #2
    what error does it return?
     
    donteatchicken, Apr 21, 2006 IP
    Greg-J likes this.