有没有办法在不重复这样的查询的情况下有效地改进下面的代码?
注意:在这种情况下,有已知数量的元素用于分配参数。
SELECT @var0 = Field_A FROM Table_0
JOIN Table_1 ON (Table_0.PK = Table_1.FK)
WHERE Table_1.PK = 1 AND TABLE_0.Field_B = 1;
SELECT @var1 = Field_A FROM Table_0
JOIN Table_1 ON (Table_0.PK = Table_1.FK)
WHERE Table_1.PK = 1 AND TABLE_0.Field_B = 2;
SELECT @var2 = Field_A FROM Table_0
JOIN Table_1 ON (Table_0.PK = Table_1.FK)
WHERE Table_1.PK = 1 AND TABLE_0.Field_B = 3;