lundi 27 juillet 2015

How get the Id of inserted row in SQL

My database table has ID column which is an auto incremental integer. While inserting data to the table its increment automatically I need to get the value of ID when a record is inserted.

Eg: table employee = |ID| NAME | ADDRESS|

the query is :

insert into employee(NAME, ADDRESS) values("azzi", "test adress")

there is a possible that we can change this query to return the ID soon after record inserted, some one help me to do that.

Aucun commentaire:

Enregistrer un commentaire