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 524 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 570 posted 11 years ago by TheNullByte
add created datetime and modified timestamp columns to table
0 505 posted 12 years ago by navblue
Create a new table from the details of another table then insert the table contents
0 571 posted 12 years ago by imbraz
xxxx1... are tables from master site xxxx2... are tables from client site
0 534 posted 12 years ago by A973C
Update an empty name column in default_comments
0 490 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 802 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 682 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 1217 posted 12 years ago by Synnoid
0 681 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 788 posted 12 years ago by nedf23
3 2332 posted 12 years ago by frederichoule
0 540 posted 12 years ago by simsevu
0 651 posted 12 years ago by athome
0 720 posted 12 years ago by athome
Get all page names and ids from the DB of pages with content containing '#'
0 610 posted 12 years ago by nielsenrc
Simple example of how you can output a query as
0 721 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 1602 posted 12 years ago by n19ht
0 675 posted 12 years ago by apro2000
remove the square brackets
0 677 posted 12 years ago by springy
Snippet used to create users on databases
1 708 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 1036 posted 12 years ago by serialk89
0 565 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 428 posted 12 years ago by muximus
0 548 posted 12 years ago by erraja_07
The datetime_field value in the database is '0000-00-00 00:00:00'.
0 531 posted 12 years ago by dsoms
For example: search_value = 3, column_value = 1,2,3,4,5,6
0 591 posted 12 years ago by dsoms
MYSQL Convertir un timestamp en heure lisible
0 596 posted 12 years ago by Phibo