Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
psiri3
Starting Member
5 Posts |
Posted - 2011-06-22 : 22:51:41
|
| Hello all, This is an emergency requirement of client..I need to write a function to populate a temporary table.My Query is this way:select p.product,max(p.price)as priceinto #temptablefrom owner.products p,(select product,max(date) from owner.products where product = 'mouse' group by product) qwhere p.product = q.product and p.date = q.dategroup by p.productThis is my query..where in I am populating the data into a table named "temptable"I need to implement this little query by using a function..I would be passing a parameter for 'mouse' through the functiu=on as Input..Please help me.. |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2011-06-22 : 23:08:11
|
you can't use FUNCTION to do that. You have to do it with Stored Procedure KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
|
|
|