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 506 posted 11 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 554 posted 11 years ago by TheNullByte
add created datetime and modified timestamp columns to table
0 486 posted 11 years ago by navblue
Create a new table from the details of another table then insert the table contents
0 554 posted 11 years ago by imbraz
xxxx1... are tables from master site xxxx2... are tables from client site
0 514 posted 12 years ago by A973C
Update an empty name column in default_comments
0 473 posted 12 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 777 posted 12 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 655 posted 12 years ago by ninacess
Most popular languages on the web table (in order of popularity). Handy for auto complete fields and such.
0 1194 posted 12 years ago by Synnoid
0 661 posted 12 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 760 posted 12 years ago by nedf23
3 2283 posted 12 years ago by frederichoule
0 520 posted 12 years ago by simsevu
0 625 posted 12 years ago by athome
0 695 posted 12 years ago by athome
Get all page names and ids from the DB of pages with content containing '#'
0 590 posted 12 years ago by nielsenrc
Simple example of how you can output a query as
0 695 posted 12 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 1556 posted 12 years ago by n19ht
0 652 posted 12 years ago by apro2000
remove the square brackets
0 655 posted 12 years ago by springy
Snippet used to create users on databases
1 687 posted 12 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 1012 posted 12 years ago by serialk89
0 551 posted 12 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 411 posted 12 years ago by muximus
0 526 posted 12 years ago by erraja_07
The datetime_field value in the database is '0000-00-00 00:00:00'.
0 514 posted 12 years ago by dsoms
For example: search_value = 3, column_value = 1,2,3,4,5,6
0 570 posted 12 years ago by dsoms
MYSQL Convertir un timestamp en heure lisible
0 569 posted 12 years ago by Phibo