How universal is the LIMIT statement in SQL?

前端 未结 7 1899
予麋鹿
予麋鹿 2020-12-03 14:21

I\'m in the process of generalizing a Django DB replication app and it uses the statement:

SELECT %s FROM %s LIMIT 1

to fetch 1 row and use

7条回答
  •  执念已碎
    2020-12-03 14:58

    It doesn't work on MSSQL (which uses SELECT TOP 10 * FROM Blah instead). That cuts out a significant portion of the DB market. I'm not sure about others.

    Also, it's possible, though very unlikely, that your DB API will translate it for you.

提交回复
热议问题