Welcome To Snipplr
Everyone's Recent SQL Snippets
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
This will create and then populate a MySQL table with a list of the names and ISO 3166 codes for countries in existence.
5
1681
posted 16 years ago by cbrant
If you ever need to build a comma delimited list out of a column in SQL you can easily do this using the COALESCE function.
0
799
posted 16 years ago by mcbutterbuns
You can store an IP address in an INT UNSIGNED (4 bytes) which is of course much more efficient and faster than a CHAR(15).
MySQL has two built-in functions: INET_ATON() and INET_NTOA(). These two functions are used allover the place in any TCP/IP s...
0
1136
posted 16 years ago by zingo
To grant all privileges to a user from any location login to the mysql shell and run the following queries.
3
922
posted 16 years ago by cbrant
To reset the MySQL root password, login to the mysql shell and run the following commands.
1
853
posted 16 years ago by cbrant
Wenn ein INSERT einen doppelten Wert erzeugen würde, wird das UPDATE ausgeführt.
1
684
posted 16 years ago by drk
https://www.chrisjmendez.com/2008/03/23/mysql-commands-i-wish-i-could-remember/
9
949
posted 16 years ago by chrisaiv
It does not show the grants themselves, but shows all users with grants.
0
854
posted 17 years ago by therobot
Generate the SQL necessary to create triggers that use the sequences listed above.
NOTE: This particular script assumes that the tables all start with ‘tbl’.
It may need to be modified to work with different naming conventions.
0
768
posted 17 years ago by thecrumb
Generate the SQL necessary to create sequences for every table.
NOTE: This doesn’t create sequences. The results need to be copied and run as a script.
0
1004
posted 17 years ago by thecrumb
Small query to help you relocate those modules you are not using anyways.
2
910
posted 17 years ago by torkil
If you are deleting all the rows in a table and you also want to reset the values that will get used by auto increment, this is how to do it.
0
977
posted 17 years ago by jachin
You can generate a simple bar chart of the values by executing this command...
0
955
posted 17 years ago by zingo