Using query result field as database name in same query

前端 未结 2 1685
别那么骄傲
别那么骄傲 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:22

    SELECT JR.JobNumber,
           JR.IsComplete,
           J.DateModified
    FROM JobRegister JR INNER JOIN CONCAT('Job', JR.JobNumber) J
    ON JR.JobNumber = J.JobNumber
    WHERE DocumentRevision = 'B';
    

提交回复
热议问题