Search
 
SCRIPT & CODE EXAMPLE
 

SQL

mysql get last id

SELECT MAX(id) FROM tablename;
Comment

mysql get last inserted id

-- To get the last inserted auto-increment row ID: --
SELECT LAST_INSERT_ID( optional_expression )

-- If you have just inserted it using a command in C# use: --
int lastId = (Int32)yourCommand.LastInsertedId;
Comment

PREVIOUS NEXT
Code Example
Sql :: concat first name and last name in mysql 
Sql :: drop column if exists sql server 
Sql :: String concatenation in PostgreSQL 
Sql :: how to alter table name in mysql 
Sql :: mysql left join exists 
Sql :: show structure of table in sql 
Sql :: reset auto increment in sql 
Sql :: oracle failed login attempts 
Sql :: oracle user tables 
Sql :: how to check database size mysql 
Sql :: sql print all names that start with a given letter 
Sql :: cross schema query oracle 2 users 
Sql :: how to copy data of a table from another database to table of anaother database 
Sql :: moodle query item quiz 
Sql :: sql remove first character from string 
Sql :: function difference_in_hours(timestamp with time zone) does not exist 
Sql :: hibernate with springboot mysql 
Sql :: How to select the nth row in a SQL database table? 
Sql :: sql get table last modified time 
Sql :: ddl view 
Sql :: change table to innodb mysql 
Sql :: mysql add 2 hours 
Sql :: update select 
Sql :: v$session table or view does not exist 
Sql :: asp.net core with postgresql deploy on ubuntu 
Sql :: transalations from sql to Linq count and group by 
Sql :: mysql select last row for each group 
Sql :: create table mysql 
Sql :: select tables from mysql database 
Sql :: what is mysql_pconnect 
ADD CONTENT
Topic
Content
Source link
Name
3+1 =