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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I query the last record only? 1

Status
Not open for further replies.

ZPlay

Technical User
Jan 10, 2002
24
US
I am trying to insert into a table the last record from another table. I tried this statement but all I got was an error.

INSERT INTO t1 SELECT * FROM t2 ORDER BY id DESC LIMIT 1

Is there another way to do this?
 
Well I tried Braindead2's solution first and Access gae me this error message:

cannot have aggregate function in WHERE clause (id=max(id))

I then tried tlbroadbents method and that seems to work perfectly. Thanks for your responses and help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top