Skip to content

Instantly share code, notes, and snippets.

@Exadra37
Created January 28, 2014 20:18
Show Gist options
  • Select an option

  • Save Exadra37/8675478 to your computer and use it in GitHub Desktop.

Select an option

Save Exadra37/8675478 to your computer and use it in GitHub Desktop.
Examples of some raw mysql querys: Insert Into.. On Duplicate Key Update
/**
*
* @author Paulo Silva(Exadra37) exadra37 in gmail point com
* @package Exadra37/Mysql-Examples
* @version 0.0.1
* @since 28/01/2014 - v.0.0.1
*
*/
INSERT INTO stores (storeName, address, phone)
VALUES ('MyStore1', 'MyAddress1', 'MyPhone1'),
VALUES ('MyStore2', 'MyAddress2', 'MyPhone2'),
VALUES ('MyStore3', 'MyAddress3', 'MyPhone3')
ON DUPLICATE KEY UPDATE
storeName = VALUES(storeName),
address = VALUES(address),
phone = VALUES(phone);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment