首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > SQL Server >

求个sql2005 整合查询结果的方法,高人进~ 多谢

2012-02-10 
求个sql2005 整合查询结果的方法,高人进~ 谢谢表 goodsidname1哈哈2呵呵select * from goods where id

求个sql2005 整合查询结果的方法,高人进~ 谢谢
表 goods
id name
1 哈哈
2 呵呵

select * from goods where id = '1'
select * from goods where id = '2'

2个查询方法执行后是2个结果,如果能把这2个结果整合到一起返回结果呢?
请指点谢谢拉~

[解决办法]

SQL code
--1select * from goods where id = '1' or id = '2'--2select * from goods where id = '1'union all select * from goods where id = '2'
[解决办法]
探讨

SQL code

--1
select * from goods where id = '1' or id = '2'
--2
select * from goods where id = '1'
union all
select * from goods where id = '2'

热点排行