how to extract the last inserted value i have two table i.e tbl_Contactgroup(id,name) and tble_contactlist(id,name,address,telephoneno,mobileno,groupid)
my question is how to retrieve all the contact list value from the tble_contactgroup by using extracting last inserted value from the tbl_Contactgroup where id in tbl_Contactgroup and groupid in tble_Contactlist are related to each other ie foreign key
SELECT id,name,address,telephoneno,mobileno 
FROM tble_contactlist 
WHERE groupid= (SELECT MAX(id) FROM tbl_Contactgroup)


Try this.. it will give you the data for all the value in contact list for the last inserted value in contactgroup