Welcome To Snipplr
Everyone's Recent MySQL Snippets Tagged mysql
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
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
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
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
<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
Get all page names and ids from the DB of pages with content containing '#'
0
610
posted 12 years ago by nielsenrc
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
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
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
The datetime_field value in the database is '0000-00-00 00:00:00'.
0
531
posted 12 years ago by dsoms