Tag Archives: MySQL

Should Tabulate support ENUM columns?

I’m trying to figure out if it’s worthwhile adding better support for enumerated fields in Tabulate. MySQL’s ENUM type is useful when one has an immutable list of options such as days of the week, seasons of the year, planets … Continue reading

Posted in Programming | Tagged , , , | Leave a comment

Tabulate 1.0.0

I’ve just realeased version 1.0.0 of Tabulate, a WordPress plugin for working with data in a site’s MySQL database. I’ve been using it for a few months in production, and the shift from 0.* to 1.0 was fairly arbitrary — … Continue reading

Posted in Programming | Tagged , , , , , , , | Leave a comment

Loading spatial data into MySQL with LOAD DATA INFILE

Just a note for my future reference: importing an Excel CSV into MySQL. The WKT column has been constructed by hand to be POINT(lng lat) and the CSV contains headers. LOAD DATA INFILE ‘/full_path/to/file-on-server.csv’ REPLACE INTO TABLE the_table COLUMNS TERMINATED … Continue reading

Posted in Programming | Tagged , , , , , , , , | Leave a comment

Joining DB records to the ‘highest’ of their related (1:m) data

I often have cause to query a database table and join it with a subtable of related data (i.e. a table with which this one has a one-to-many relationship), and to retrieve only the highest (or lowest) of related records … Continue reading

Posted in Programming | Tagged , , , | Leave a comment

Finding all date ranges (which may be open-ended) that overlap with a given range

Given a database table listing events and their date ranges: events { id, start_date, end_date, … }, where either or both of the dates can be null, how is one to find all of the events that fall within (even … Continue reading

Posted in Programming | Tagged , , , , , , , | Leave a comment