Deleting records older than X hours

2011-07-31 Thread hezjing
Hi I want to delete the records which are older than two hours from a table. Currently, I have scheduled a cron job script to delete the records every one hour. I'm wondering if there is a more elegant way of doing this with out the cron job script? -- Hez

Selecting from the range of serial numbers

2009-07-24 Thread hezjing
Hi My stock serial number format is 1A - 9A, 1B - 9B ... 1Z - 9Z. These stocks are check in to warehouse in different order, so the worker may check in the stocks like 1A - 00100A 9B - 00010C 00051B - 00070B I have a table to keep track the stock check in transa

How to specify CHAR column to accept specific characters

2009-06-18 Thread hezjing
Hi I'm using MySQL 5.1. How do we create a constraint on char column to accept only character 'A' - 'Z'? Thank you! -- Hez

Why different engines in one database?

2008-10-11 Thread hezjing
Hi When and why we create tables in different storage engines within a same database? Take for example a normal inventory application that provides CRUD operation to - USER table (e.g. create new user) - STOCK table (e.g. when there is new stock arrives) - CUSTOMER table (e.g. create new customer)