表A
表B
显示结果
效果图:
sql语句如下
sql;">
SELECT
(SELECT B2 FROM B WHERE B1=A1) AS A1,(SELECT B2 FROM B WHERE B1=A2) AS A2,(SELECT B2 FROM B WHERE B1=A3) AS A3,(SELECT B2 FROM B WHERE B1=A4) AS A4
FROM A
这样就ok了
原文链接:https://www.f2er.com/mssql/62716.html