Good Team Plays Hard
In: MySQL
30 Jan 2010MySQL doesn’t allow referring to a table that’s targeted for update in a FROM clause, which can be frustrating. There’s a better way than creating endless temporary tables, though. This article explains how to update a table while selecting from it in a subquery. Recently I am assigned to update a bunch of records in [...]
This tutorial describes how to set up database replication in MySQL. MySQL replication allows you to have an exact copy of a database from a master server on another server (slave), and all updates to the database on the master server are immediately replicated to the database on the slave server so that both databases [...]
Recently I am planning to do a maintenance job on a log table and I am suppose to write a sql script that keep the latest records and delete all the legacy records. My first try is select col1, max(created_date) from <table_name> group by col1; Using the above sql, I am able to list out [...]
In: MySQL
26 Nov 2009Today a colleague ask me how to obtain a full list of all users in a mysql database. The first thing come into my mind is SELECT * FROM all_users; Then I realize this is for oracle database only. The dilemma of using multiple database is sometimes you might get their syntax all mix up. [...]
In: MySQL
22 Jun 2009Recently I am trying to compile a report from MySQL database using “order by” clause to sort the priority_no field. However I discover the result is not in order at all. Then I try to check out the data type of priority_no field and discover that it is configure as varchar. So I just use [...]
In: MySQL
17 Jun 2009Recently I was asked to find address duplication in an MySQL table that have 3 columns: street_no., street_name, district. So the first step I took is to remove all white spaces in all those 3 fields and just store them in a temp table. INSERT INTO table2 (street_no, street_name, district) SELECT replace(table1.street_no, ‘ ‘, ”), [...]
In: MySQL
11 Jun 2009Recently I have to deal with MySQL because of the project I am involved in. Since there is no phpMyAdmin provided, I got to find the alternative. At first I try to use the oracle sqldeveloper, but it only provide view only function. Then I just use Navicat for MySQL. It is a nice tool [...]
This is a place I create just for fun and to write down some experience and notes for myself. So feel free to enjoy and drop any comments you have. I had been employed as Programmer, System Analysts, System Administrator, DBA and Project Manager. I will share some of my case study here as well. Enjoy!