What is the equivalent to Access' 'SELECT DISTINCTROW * FROM...' in SQLite?
I am converting a DB from Access to SQLite and therefore have to convert/debug all of the sql queries as well. Came across this one:
S开发者_如何学运维ELECT DISTINCTROW * FROM table WHERE column = value ORDER BY column2;
What is the equivalent query using SQLite?
SELECT DISTINCT * FROM table WHERE column = value ORDER BY column2;
Since there's only one table involved, DISTINCTROW
acts like DISTINCT
.
The equivalent is to ensure that all your tables have keys and that you implement joins and the rest of your query correctly. If you do that then you will never need anything like DISTINCTROW. DISTINCTROW is no more than just a legacy of silliness from Jet.
SELECT * is poor practice. List the columns by name.
SELECT column, column1, column2
FROM table
WHERE column = value
ORDER BY column2;
精彩评论