我有两个存储过程,如下所示:
Select distinct TempName from History_Table
Select TempName,RunDate from History_Table where TempName=@tempname
如何使用单个存储过程来获取不同的结果集tempname
及其关联RunDate
?
TempName RunDate RunBy
1 test 2012-10-11 00:00:00.000 chandu
2 testing 2012-12-15 00:00:00.000 kumar
3 asdsad 2012-08-09 00:00:00.000 asdsad
4 test 2012-12-12 00:00:00.000 asdasds
15 test 2012-10-01 00:00:00.000 asdaddf
15 test 2012-09-12 00:00:00.000 bghgh
I have to display like
TempName RunDate RunBy
test dates(in a dropdown) lastrun name(i.e asdasds)