Welcome To Snipplr


Everyone's Recent SQL Snippets Tagged mysql



sometimes we botch an import, and end up with return or newline characters in the field. So fields which should be empty have \r in them, or fields with text data have an invisible trailing newline. This makes it impossible to match the text values....
0 1526 posted 15 years ago by powerthru
1 1262 posted 15 years ago by traeregan
This is the quick method and painless way to Remove duplicate entries from MySQL
2 1613 posted 15 years ago by lixonic
SQL to alter field contents. linked article is in german.
1 1637 posted 15 years ago by iroybot
Change a user password
0 1329 posted 15 years ago by manuelstofer
creates a user that has only access to one database, from any host
1 1818 posted 16 years ago by manuelstofer
2 1322 posted 16 years ago by czapata
Using SQL you can have your database return the distance between 2 sets of Lat and Long points, and using some math functions also take into account the curvature of the earth.
3 2341 posted 16 years ago by zingo
1 1866 posted 16 years ago by Mithun
If you need to list all of the MySQL databases managed by Plesk along with their corresponding domains and login credentials, you can use this query:
1 1560 posted 16 years ago by tobewan
4 1832 posted 16 years ago by pdswan
This is by no means the most efficient way to do this, in terms of performance. It is however the easiest way.
1 1604 posted 17 years ago by xtheonex
get some random record from mysql quickly。
0 1602 posted 17 years ago by liuran
0 1533 posted 17 years ago by jachin
0 1651 posted 17 years ago by ginoplusio
1 1606 posted 17 years ago by ginoplusio
1 1098 posted 17 years ago by ericserrat
0 1965 posted 17 years ago by Wardy
0 1502 posted 17 years ago by therobot
0 1353 posted 17 years ago by hdanniel
Creates a MySQL table with all 50 states + Washington D.C. in alphabetical order.
1 1362 posted 17 years ago by simplistik
Where bad_table is the name of the table containing duplicate rows.
2 1250 posted 17 years ago by jdbartlett
This is useful if you are changing a Drupal site's file upload path and/or changing from a private to a public file store.
3 2732 posted 17 years ago by shrop
Imports data from CSV (excel-compatible format) into MySQL. Also check the mysqlimport utility and the complementary SELECT ... INTO OUTFILE.
4 2143 posted 17 years ago by jarnaldich
This will create and then populate a MySQL table with a list of the names and USPS abbreviations for US states and possessions in existence.
3 4179 posted 17 years ago by cbrant