I am using a standard order by SQL clause SELECT BKTitle, Author ORDER BY BKTitle however a lot of the book titles are enclosed in apostrophes e.g. 'New Raiments of Self' appears before - A Guide to Retail Success. How can I return this list alphabetically ignoring any leading apostrophes.
That works but only if I remove my DISTINCT clause otherwise I get
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC SQL Server Driver][SQL Server]ORDER BY items must appear in the select list if SELECT DISTINCT is specified.
Apologies I didn't specify this. We have a site with a database format controlled by another system for publishing our books. Each title is listed twice, once for hardback and once for paperback so we added DISTINCT so that the book list did not contain two of everything.
SELECT Distinct BKTitle, Author From <yourTable> ORDER BY 1 or worst case Select BKTitle, Author From (Select Distinct BKTitle, Author From <yourTable>) A Order By 1
Corey Secret Service Agent: Mr. President, you're urinating on me. President Lyndon Johnson: I know I am. It's my prerogative.