MySQL INSERT INTO table VALUES.. vs INSERT INTO table SET

As far as I can tell, both syntaxes are equivalent. The first is SQL standard, the second is MySQL’s extension. So they should be exactly equivalent performance wise. http://dev.mysql.com/doc/refman/5.6/en/insert.html says: INSERT inserts new rows into an existing table. The INSERT … VALUES and INSERT … SET forms of the statement insert rows based on explicitly … Read more

LEFT function in Oracle

There is no documented LEFT() function in Oracle. Find the full set here. Probably what you have is a user-defined function. You can check that easily enough by querying the data dictionary: But there is the question of why the stored procedure works and the query doesn’t. One possible solution is that the stored procedure is … Read more

How to create id with AUTO_INCREMENT on Oracle?

There is no such thing as “auto_increment” or “identity” columns in Oracle as of Oracle 11g. However, you can model it easily with a sequence and a trigger: Table definition: Trigger definition: UPDATE: IDENTITY column is now available on Oracle 12c: or specify starting and increment values, also preventing any insert into the identity column … Read more