狐表与SQL结合方法:
Dim s1,sql As String
Dim Arys As List(Of String())
Arys = DataTables("原表").SQLGetValues("列B|编码|列A","列B > ''")
s1=" Union All Select 编码,列A,'T0' As 列B From{原表} Where 编码 = 'T1' and 列A ='T2'"
For Each Ary As String() In Arys
sql+ = s1.Replace("T0",Ary(0)).Replace("T1",Ary(1)).Replace("T2",Ary(2))
Next
If SQL > "" Then
Output.show(SQL.Substring(11))
End If