Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update only last record 1

Status
Not open for further replies.

stephenbruceburch

Technical User
Jun 1, 2002
11
0
0
US
I have two tables an Inventory and a Transaction. I want to update the inventory whenever a transaction is made. but the problem I am having is that it updates the inventory for every transaction. I tried using WHERE Transaction.ID = MAX(TRANSACTION.ID) but it errored and said I couldn't use an aggregate function in a where statement. Please Help.
 
The sql syntax is to use a select statement to return the id.

WHERE Transaction.ID = (Select MAX(TRANSACTION.ID) From Transaction)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top