Using query result field as database name in same query

前端 未结 2 1714
别那么骄傲
别那么骄傲 2021-01-29 00:53

Probably a long shot with this...

I have two databases \"Job Register\" and \"Job001\".

I want to retrieve a list of the jobs that have had a meeting, and the la

2条回答
  •  渐次进展
    2021-01-29 01:17

    Your question is unclear a bit, but I think you are looking for

    SELECT JR.JobNumber,
           JR.IsComplete,
           J.DateModified
    FROM JobRegister JR INNER JOIN Job001 J
    ON JR.JobNumber = J.JobNumber
    WHERE DocumentRevision = 'B'; 
    

    Also JobNumber in both tables should be the same datatype.

    Demo

提交回复
热议问题