The poor man’s CRM, a.k.a SuiteCRM, is great (… was great for its time!); that’s another story. One of the features provided is “unified search”, as the geeks call it; some may call it global/universal search across many tables and records in the database. What it does is simply as follows: Loop over a list … Read morePoor man’s full text search for SuiteCRM
Recently, I’ve come across this error: MySQL error 1436: Thread stack overrun: 164720 bytes used of a 196608 byte stack, and 32000 bytes needed. Use ‘mysqld –thread_stack=#’ to specify a bigger stack. I am using PHP 7.0 and MySQL 5.7 on a Ubuntu 16.04 VM. Basically, I was dynamically creating more than 5 long SQL … Read moreMySQL Error: Thread stack overrun
One of the tricky issues in entity relationship model is the recursive relationships. Sometimes an entity needs to refer to itself. For example, think of an organisational chart for the roles of employees in a company; each employee is managed by a manager, each manager manages 0 or more employees. The records of all the … Read moreRecursive Relationships in Databases
After years of torturing their SQL Server users, Microsoft provided a “better” way of paging records in version 2005, and it is a weird one! The following example is from their website, an article about ROW_NUMBER (Transact-SQL).
WITH OrderedOrders AS
SELECT SalesOrderID, OrderDate,
ROW_NUMBER() OVER (ORDER BY OrderDate) AS 'RowNumber'
WHERE RowNumber BETWEEN 50 AND 60;
It is simply unacceptable, non-standard, impractical! By the way, you can not use column numbers (e.g. ORDER … Read morePaging records in MS SQL Server 2005