Welcome To Snipplr


Everyone's Recent MySQL Snippets Tagged mysql



You have two tables galleries and images, and you need to know how many images each gallery has associated with it. This Query returns the sum of distinct record joined to another table by a common field (gallery_id).
0 1790 posted 15 years ago by jbranca
0 1100 posted 15 years ago by kaartz
Syntax used to create a table in MySQL. Replace column names as appropriate. Primary key should also be modified to suite needs.
2 1295 posted 15 years ago by dkynyc
View the syntax used to create a table called time_zone.
1 1144 posted 15 years ago by dkynyc
Allows us to see the syntax used to create a database.
1 1171 posted 15 years ago by dkynyc
Issue commands via batch mode.
2 1275 posted 15 years ago by dkynyc
0 1343 posted 15 years ago by Jamie
1 1415 posted 15 years ago by electblake
Display records older than one week.
1 1396 posted 15 years ago by galofre
1 907 posted 15 years ago by gcman105
How to add an auto-incremented column to an existing table without ex- and reimporting.
0 1624 posted 15 years ago by simondiercks
Simply uncomment the appropriate line for some common, useful Administration SQL statements for MySQL. (Uncomment and run 1 line at a time)
0 1134 posted 15 years ago by zonetrooperex
Manejo de fechas y formateado MYSQL
0 1230 posted 15 years ago by xaviles
Esquema basico de manejo de cursores en MYSQL
0 1402 posted 15 years ago by xaviles
Esquema de sentencias para el control de errores en SP de MYSQL. Es un metodo basico
0 1599 posted 15 years ago by xaviles
This is useful for when a Wordpress environment goes live; typically the uploads have an absolute URL.
5 1923 posted 15 years ago by Jamie
General MySQL engine related commands
0 1211 posted 15 years ago by sukantahazra
0 1188 posted 15 years ago by atma
I use something similar to the example to get the difference between statuses in a status log table that I have. It comes in handy when determining the number of days between status changes. This works in MySQL 5.0.
0 1676 posted 15 years ago by bradless
1 1362 posted 15 years ago by therobot
If the official codex approach (http://codex.wordpress.org/Changing_The_Site_URL) is causing you problems, give this a try. Be sure to change the constant declarations and modify table names as necessary for your instance. Confirmed working with WP v...
1 1904 posted 15 years ago by johnandrewsroot
0 1354 posted 15 years ago by bradless