Welcome To Snipplr
Everyone's Recent MySQL Snippets
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
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
610
posted 12 years ago by jbranca
Syntax used to create a table in MySQL. Replace column names as appropriate. Primary key should also be modified to suite needs.
2
454
posted 12 years ago by dkynyc
How to add an auto-incremented column to an existing table without ex- and reimporting.
0
624
posted 12 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
359
posted 13 years ago by zonetrooperex
Esquema de sentencias para el control de errores en SP de MYSQL. Es un metodo basico
0
705
posted 13 years ago by xaviles
Just run the following query on your WordPress database, and all revisions (As well as meta associated with it) will be deleted from your database.
2
504
posted 13 years ago by jessibird
This is useful for when a Wordpress environment goes live; typically the uploads have an absolute URL.
5
705
posted 13 years ago by Jamie
After a problem with row break in a text field I found this way of searching within a where clause in an SQL query. Can be used for selection or update / replace purposes of course.
0
942
posted 13 years ago by davidrinnan
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
665
posted 13 years ago by bradless