Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
378 views
in Technique[技术] by (71.8m points)

java - SQL error or missing database (near "(": syntax error)

I have a big problem with SQLite in Java. When I run this query with MariaDB everything works perfectly, but with SQLite not. Does anyone know an answer?

Query:

SELECT *
FROM (SELECT *, RANK() OVER (ORDER BY kills DESC) AS ranking FROM sp_rageffa) AS `*2`
WHERE uuid = 'b71e5129-7216-4d79-b79f-2e3893a6befa';

Error:

SQL error or missing database (near "(": syntax error)

question from:https://stackoverflow.com/questions/65877393/sql-error-or-missing-database-near-syntax-error

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I tried it in the database browser, and there's nothing wrong with your command. Support for that syntax was introduced in version 3.25 of sqlite, and jdbc (the java interface with sqlite) using pretty much the same versioning scheme, so you should make sure you're using a version of jdbc numbered 3.25 or higher.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...