Search code examples
sqlsqliteampersand

Ampersand in sqlite query


How to construct sqlite query containing ampersand in filter:

SELECT id FROM mediainfo WHERE album="Betty & Kate";

I use sqlite C interface (sqlite3_bind_text() and ? marks while query building) but neither C query nor SQLite Administrator return any data


Solution

  • & is not a special character either in C strings or in SQL strings, so I don't think that's the problem. Try the same query from a tool like SQLite Database Browser.