Welcome To Snipplr
Everyone's Recent MySQL Snippets Tagged mysql
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
This commands are useful in creating a username in mysql and it can be used to access the mysql globally with this username.
0
801
posted 5 years ago by surentharp
This snippet allows you to get random record from given table by weight. To run it, it must have a field named "weight". The more "weight" is assigned, the more often the record is selected. The value of "weight" should be an integer between 1 and 10...
0
943
posted 6 years ago by apphp-snippets
`mysql-dev.ini` can be used in a developing environment and put it in the Mysql Home dir
0
934
posted 9 years ago by jacktan
This will get the names of all the columns as one long string ready to use in a select statement. N.B. There is a list of column names to exclude (In this case '???COLUMNS_TO_EXCLUDE???')
0
858
posted 9 years ago by imbraz
Sets up the database for my project management software (in development - C#)
0
841
posted 10 years ago by JordanRowles
MySQL has a handy and simple string function REPLACE() that allows table data with the matching string to be replaced by new string. This is useful if there is need to search and replace a text string which affects many records or rows, such as chang...
0
944
posted 10 years ago by apphp-snippets
This is a very simple snippet about how to create a database 1st, a user and then assign some privileges to the user to allow him/her to perform some specific actions like insert, create, update, select etc.
0
811
posted 10 years ago by apphp-snippets
I found this script and tried it. It worked. I thought it was useful for a variety of situations and is easy to follow.
Often times I need nearly duplicated data and don't want to manually cut and paste.
0
783
posted 10 years ago by donkeykong
Prints out a list of any field containing duplicates with count
0
761
posted 10 years ago by flatearthcomms
MySQL
La fonction COALESCE de MySQL permet de renvoyer une valeur par défaut si la valeur null est renvoyée initialement.
Le fonction COALESCE de MySQL permet de renvoyer une valeur par défaut si la valeur null est renvoyée initialement.
0
986
posted 11 years ago by pruntrut
By using HAVING 'virtual_field' CONDITION we can add conditions to virtual fields that created at SELECT
0
765
posted 11 years ago by tucq88
Create a new database and its respective user with all privileges
0
558
posted 11 years ago by claudiodev
How to remap a value to another inside a mysql query select.
0
901
posted 11 years ago by ginoplusio
You could start a transaction before running your queries and then rollback after running them. Note that to do this you'll require InnoDB or XtraDb tables (won't work on MyISAM).
0
815
posted 11 years ago by satie83
You have a schedule table (period, day, subject, room) with a primary key period,day to avoid duplicate bookings. You wish to display the schedule as periods, subjects and rooms in rows, and days of the week in columns.
0
676
posted 11 years ago by cahyadsn