Skip to content
This repository has been archived by the owner on Nov 9, 2021. It is now read-only.

Incorrect syntax near '`'. #374

Open
AlexanderTunick opened this issue Jan 8, 2019 · 0 comments
Open

Incorrect syntax near '`'. #374

AlexanderTunick opened this issue Jan 8, 2019 · 0 comments

Comments

@AlexanderTunick
Copy link

AlexanderTunick commented Jan 8, 2019

Hi, can't figure out why I can't make a simple query.

let a = squel.select({ separator: '\n' })
            .from("dbo.Person", "p")
            .field("count(distinct p.personId)")
            .left_join("dbo.OrganizationDetail", "od", "od.OrganizationUniqueID = p.OrganizationUniqueID")
            .toString()

Output:

SELECT
count(distinct p.personId)
FROM dbo.Person `p`
LEFT JOIN dbo.OrganizationDetail `od` ON (od.OrganizationUniqueID = p.OrganizationUniqueID)

Error: RequestError: Incorrect syntax near '`'.

I see that the problem is under '`' sign, but why it formed like this? Could I somehow avoid these cross quotes?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant