English 中文(简体)
了解邮政局的神秘性。 [复制]
原标题:Equivalent of mysql_insert_id() for Postgresql? [duplicate]
This question already has answers here:
Closed 13 years ago.

Possible Duplicate:
mysql_insert_id alternative for postgresql

是否有相当于我sql_insert_id()的Pogresql等值,以获得最后一批人产生的身份证?

问题回答

如果您正在使用《邮资指南》8.2或新版本,那么最简单的办法是使用<编码>。 附录:

$result = pg_query($db, "INSERT INTO foo (bar) VALUES (123) RETURNING foo_id");
$insert_row = pg_fetch_row($result);
$insert_id = $insert_row[0];

其他替代品见。 这一重复





相关问题
摘录数据

我如何将Excel板的数据输入我的Django应用? I m将PosgreSQL数据库作为数据库。

Postgres dump of only parts of tables for a dev snapshot

On production our database is a few hundred gigabytes in size. For development and testing, we need to create snapshots of this database that are functionally equivalent, but which are only 10 or 20 ...

How to join attributes in sql select statement?

I want to join few attributes in select statement as one for example select id, (name + + surname + + age) as info from users this doesn t work, how to do it? I m using postgreSQL.

What text encoding to use?

I need to setup my PostgreSQL DB s text encoding to handle non-American English characters that you d find showing up in languages such as German, Spanish, and French. What character encoding should ...

SQL LIKE condition to check for integer?

I am using a set of SQL LIKE conditions to go through the alphabet and list all items beginning with the appropriate letter, e.g. to get all books where the title starts with the letter "A": SELECT * ...

热门标签