Conversion failed when converting the varchar value 'Id' to data type int

前端 未结 2 1209
失恋的感觉
失恋的感觉 2021-01-05 11:52

I got this error when trying run my sql query...

Conversion failed when converting the varchar value \'Id\' to data type int

2条回答
  •  孤城傲影
    2021-01-05 12:05

    Try casting Id column to INT

    SELECT *
    FROM History
    INNER JOIN Header
    ON cast(History.Id AS int) = Header.docId
    

提交回复
热议问题