« They can tell when I don't have my camera | Main | Overwhelming »

Long time, no join

It has been quite a while (three years) since I took Database Management, and since then I’ve mostly just been doing CRUD for websites.

Now I’ve got a situation where I should probably use a join. A left join, specifically. To put this in non-technical terms, I can either get two batches of data (from two database tables) and correlate them myself in the application, or I can combine the tables temporarily and grab a single batch of data. I can go a long way around the mountain range on flat land, or start climbing and take a shortcut through the pass.

If only I could remember the proper syntax for joins, and exactly which one I wanted, without having to scan the manual.

Now Playing: Round Here from August & Everything After by Counting Crows

Comments

Okay, I am a big technology dork, but I would create a view in this situation. Just FYI.

Views aren’t available in this version of MySQL. (They start in the 5.0 series, which we haven’t moved to yet.) Joins are dangerous, though; they can be processor- and memory-intensive (hence the climbing) which can really slow down a web site.

Post a comment