Set RS = conn.execute("select top 2 *,1 from ai_mssql.uuu.dbo.SD_InfoClass union all select top 5 *,2 from cctv.ceshi.dbo.a")
select top 2 *,[from]=1 from ai_mssql.uuu.dbo.SD_InfoClass union all select top 5 *,[from]=2 from cctv.ceshi.dbo.a
Set RS = conn.execute("select top 2 *,[type]=1 from ai_mssql.uuu.dbo.SD_InfoClass union all select top 5 *,2 from cctv.ceshi.dbo.a") While Not RS.EOF response.write(rs("ClassName")&"---"&rs("type")) response.write("<BR>") RS.MoveNext WEnd
Set RS = conn.execute("select top 2 * ,1 as 'from' from ai_mssql.uuu.dbo.SD_InfoClass union all select top 5 *,2 from cctv.ceshi.dbo.a") While Not RS.EOF response.write(rs("ClassName")) response.write("<BR>") RS.MoveNext WEnd
不好意思,上面没有把‘1’‘2’输出来,请看下面: Set RS = conn.execute("select top 2 * ,1 as 'from' from ai_mssql.uuu.dbo.SD_InfoClass union all select top 5 *,2 from cctv.ceshi.dbo.a") While Not RS.EOF response.write(rs("ClassName"))"&"----"&rs("from")) response.write("<BR>") RS.MoveNext WEnd
While Not RS.EOF
response.write(rs("ClassName")&"---"&rs("type"))
response.write("<BR>")
RS.MoveNext
WEnd
While Not RS.EOF
response.write(rs("ClassName"))
response.write("<BR>")
RS.MoveNext
WEnd
Set RS = conn.execute("select top 2 * ,1 as 'from' from ai_mssql.uuu.dbo.SD_InfoClass union all select top 5 *,2 from cctv.ceshi.dbo.a")
While Not RS.EOF
response.write(rs("ClassName"))"&"----"&rs("from"))
response.write("<BR>")
RS.MoveNext
WEnd