You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What is the output of the command above with the -d flag added to it? (Provided you are comfortable sharing this, it contains a blueprint of your schema)
SELECT TOP (10) DISTINCT some_table.* FROM some_table;
mssql: Incorrect syntax near the keyword 'DISTINCT'.
bind failed to execute query
Please provide a relevant database schema so we can replicate your issue (Provided you are comfortable sharing this)
Further information. What did you do, what did you expect?
If you're having a generation problem please answer these questions before submitting your issue. Thanks!
What version of SQLBoiler are you using (
sqlboiler --version
)?v4.2.0
What is your database and version (eg. Postgresql 10)
Microsoft SQL Server 2019
If this happened at generation time what was the full SQLBoiler command you used to generate your models? (if not applicable leave blank)
If this happened at runtime what code produced the issue? (if not applicable leave blank)
What is the output of the command above with the
-d
flag added to it? (Provided you are comfortable sharing this, it contains a blueprint of your schema)Please provide a relevant database schema so we can replicate your issue (Provided you are comfortable sharing this)
Further information. What did you do, what did you expect?
The query builders construct query by adding the
TOP
statement before theDISTINCT
(https://github.com/volatiletech/sqlboiler/blob/master/queries/query_builders.go#L53-L76)Valid syntax (at least on MS SQL) is
SELECT DISTINCT TOP (10) ...
https://stackoverflow.com/a/37642799Note: Reason why there's a
DISTINCT
is because I have joins for conditional statements on the query.The text was updated successfully, but these errors were encountered: