Archive for category SQL Command
MySql dba
Posted by mahamuddhk in MySQL Command on April 28, 2012
1. Dba backup in mysql linux
mysql -u root -p******* db_name<ip_location.sql
MySQL Quick Ref
Posted by mahamuddhk in MySQL Command on January 19, 2011
1. Days count command
SELECT to_days(curdate())-to_days(“2011-01-10”);
2. Show create table command
SHOW CREATE TABLE blog;
3. Left join query
$sql = “SELECT u.username, up.thumbnail,up.user_photo FROM user u LEFT JOIN
(SELECT user_id, thumbnail,user_photo FROM user_profile_photo WHERE status = 1) up
ON up.user_id = u.id WHERE u.username LIKE ‘”.$_GET[“term”].”%’ LIMIT 5″;