0

私はT SQLを初めて使用します。共通の列の値に従ってそれらを組み合わせる必要がある2つのクエリがあります。両方のクエリは個別に正常に機能しています。

最初のクエリは

SELECT t_senderTable.nameFull AS "senderName", t_recieverTable.recieverName AS "recieverName" 
FROM ((dbo.t_senderTable AS t_senderTable
     INNER JOIN t_senderTable AS t_senderTable ON (t_senderTable.Kd = mapTable.senderID))
     INNER JOIN t_recieverTable AS t_recieverTabler ON (recieverTable.Id = mapTable.recieverID )

2番目のクエリは

SELECT t_license AS "License", t_coName AS "Company Name" 
FROM (dbo.t_license AS t_license
     INNER JOIN dbo. t_coName ON ( t_coName.id = t_license.senderID ))
WHERE
(
  t_license.check < '2' )

基本的に、2 つのクエリを組み合わせる必要があるため、2 つのクエリで共通の sendID を使用すると、senderName、recieverName、および coName senderID の出力結果が 1 対多の関係になります。この投稿からアイデアを得ていましたが、それを機能させることはできませんSQL Server クエリの結合 それ についてのアイデアはありますか? ありがとう

4

2 に答える 2