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 |
graz
Chief SQLTeam Crack Dealer
4149 Posts |
Posted - 2000-08-13 : 00:00:00
|
dBUDI writes "I want to convert the SQL command below (from ms Access 2000) to Stored Procedure(ms SQL Server 7.0)EXAMPLE:tables:tbl_MasterNIK Name_of_Employee111 dNita222 Bariqi333 Unietty444 Datoen555 Intantbl_LoanNIK Date Amount111 8/2/00 $100.00111 8/8/00 $50.00333 8/2/00 $225.00444 8/2/00 $75.00444 8/21/00 $30.00SQL syntax:SELECT tbl_Master.NIK, First(tbl_Master.Name_of_Employee) AS FirstOfName_of_Employee, Sum(tbl_Loan.Amount) AS SumOfAmountFROM tbl_Master INNER JOIN tbl_Loan ON tbl_Master.NIK = tbl_Loan.NIKGROUP BY tbl_Master.NIK;output:NIK FirstOfName_of_Employee SumOfAmount111 dNita $150.00333 Unietty $225.00444 Datoen $105.00my question is, how to get such output above by using stored procedure in SQL Server." SQL Server doesn't support the FIRST function so you won't be able to use that. You also don't need the semicolon at the end. Other than that it should work fine in SQL Server. |
|
|
|
|