Welcome To Snipplr


Everyone's Recent MySQL Snippets Tagged mysql



Given a birthdate in @dob, here are two simple formulae for age in years : (the second formulae is for age in years to two decimal places, ignoring day of month)
0 1513 posted 14 years ago by cahyadsn
Instead of the standard return of duplicates, this will actually show the rows that are duplicated, making it easier to see the data
0 1792 posted 14 years ago by TheNullByte
add created datetime and modified timestamp columns to table
0 1529 posted 14 years ago by navblue
Create a new table from the details of another table then insert the table contents
0 1657 posted 14 years ago by imbraz
xxxx1... are tables from master site xxxx2... are tables from client site
0 1563 posted 14 years ago by A973C
Update an empty name column in default_comments
0 1556 posted 14 years ago by jgomez
Example: There is a table, 'user', with a column, 'clear', containing values such as: `clear -------- \'animal\' \'pass'\ ` and we would like to retrieve 'animal' and 'pass' ( without the pre & post \' )
0 2255 posted 14 years ago by jgomez
Select wp_users and wp_posts to retrieve data from both tables in order to display post title, post date, author name with gravatar (gravatar isn't listed in this code) Note: probably not idea solution, but it's one of many fixes
0 1815 posted 14 years ago by ninacess
Most popular languages on the web table (in order of popularity). Handy for auto complete fields and such.
0 3417 posted 14 years ago by Synnoid
0 1875 posted 14 years ago by irishsk
<h1>What it does</h1> <p>This snippet is used to pull data from one server to another. I primarily use it to get the latest data from our production to our development environments. The first part of the command is where the data is pulling from a...
1 3209 posted 14 years ago by nedf23
3 5249 posted 14 years ago by frederichoule
0 1910 posted 14 years ago by simsevu
0 1801 posted 14 years ago by athome
0 1931 posted 14 years ago by athome
Get all page names and ids from the DB of pages with content containing '#'
0 1759 posted 15 years ago by nielsenrc
Simple example of how you can output a query as
0 1907 posted 15 years ago by Jamie
Con estas instrucciones se pueden corregir los caracteres latinos que hayan sido almacenados erróneamente en una base de datos MySQL
1 3110 posted 15 years ago by n19ht
0 2128 posted 15 years ago by apro2000
remove the square brackets
0 1950 posted 15 years ago by springy
Snippet used to create users on databases
1 1973 posted 15 years ago by digitalclubb
Seleccion los datos mas repetidos de una tabla y los ordeno por la cantidad que se repiten, sirve para seleccionar a los usuarios más activos por ejemplo, etc.
0 2196 posted 15 years ago by serialk89
0 1648 posted 15 years ago by kidmizere
Get closest location to a set of gps coordinates (x, y) given a database table with columns lat(latitude) and lng(longitude)
0 1281 posted 15 years ago by muximus
0 1638 posted 15 years ago by erraja_07
The datetime_field value in the database is '0000-00-00 00:00:00'.
0 1761 posted 15 years ago by dsoms
For example: search_value = 3, column_value = 1,2,3,4,5,6
0 1514 posted 15 years ago by dsoms
MYSQL Convertir un timestamp en heure lisible
0 1753 posted 15 years ago by Phibo