Skip to content

Incorrect syntax near '`'. #374

Description

@AlexanderTunick

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions