S shiguoxing Unregistered / Unconfirmed GUEST, unregistred user! 2009-02-19 #1 CREATE PROCEDURE DelphiSql ( @age int )AS select * from person where nianling>@age;select * from person where nianling<@age;GO
CREATE PROCEDURE DelphiSql ( @age int )AS select * from person where nianling>@age;select * from person where nianling<@age;GO
S smlabc Unregistered / Unconfirmed GUEST, unregistred user! 2009-02-19 #2 改为:CREATE PROCEDURE DelphiSql ( @age int,@QueryType int )AS if @QueryType=1 then select * from person where nianling>@ageelse if @QueryType=2 then select * from person where nianling<@age;endifGO 手上没数据库,随便写了下,大概就是这个意思了
改为:CREATE PROCEDURE DelphiSql ( @age int,@QueryType int )AS if @QueryType=1 then select * from person where nianling>@ageelse if @QueryType=2 then select * from person where nianling<@age;endifGO 手上没数据库,随便写了下,大概就是这个意思了
Z znxia Unregistered / Unconfirmed GUEST, unregistred user! 2009-02-19 #4 是不是想取的2个sql的合并结果?select * from person where nianling>@age union allselect * from person where nianling<@age;
是不是想取的2个sql的合并结果?select * from person where nianling>@age union allselect * from person where nianling<@age;
S shiguoxing Unregistered / Unconfirmed GUEST, unregistred user! 2009-02-19 #5 调用一次存储过程,可以同时得到两个查询结果,同时在两个DBGridEh表格显示数据。smlabc兄做法分明需调用二次存储过程啊
Z znxia Unregistered / Unconfirmed GUEST, unregistred user! 2009-02-19 #6 存储过程不能实现你的这种要求,要不你还是想想其它办法吧。
S shiguoxing Unregistered / Unconfirmed GUEST, unregistred user! 2009-02-19 #8 草原骏马兄说调用一个过程,可以返回多个结果集的,你自己找找。