Re: Dear Dr Who experts...

2014-10-09 Thread Mark Keating
Hi Nicholas, IIRC the hatch isn't in the Tardis ceiling, but in an underground chamber of Skaro. I think you might mean the episodes Destiny of the Daleks in Season 17: http://www.bbc.co.uk/doctorwho/classic/episodeguide/destinydaleks/ Tom didn't do many Dalek stories, but he does climb up

Re: Dear Dr Who experts...

2014-10-09 Thread Joel Bernstein
Doesn't the plot of one of the 1960s films hinge on the Daleks not being able to levitate though? Bit inconsistent. Are the films not considered canonical? On 8 October 2014 16:27, David Dorward da...@dorward.me.uk wrote: On 8 Oct 2014, at 11:19, Nicholas Clark wrote: IIRC there's a scene in

Re: Dear Dr Who experts...

2014-10-09 Thread Joel Bernstein
I think I meant this film: http://en.wikipedia.org/wiki/Dr._Who_and_the_Daleks On 8 October 2014 21:11, Joel Bernstein j...@fysh.org wrote: Doesn't the plot of one of the 1960s films hinge on the Daleks not being able to levitate though? Bit inconsistent. Are the films not considered

Getting the latest related record from a SQL DB

2014-10-09 Thread Andrew Beverley
Hi guys, I'm after some best-practice advice regarding SQL database design. I have a table (say artist, couldn't resist...) that has a one-to-many relationship to another table (say album). The album table has a field which references the artist table's ID. So one artist can have many albums.

Re: Dear Dr Who experts...

2014-10-09 Thread Moray Jones
You're all making a very common error - it's not Dr Who, it's Mr Who. I remember it from Trivial Pursuit. Or was that something to do with Star Trek...can never remember. On 9 October 2014 09:17, Mark Keating m.keat...@shadowcat.co.uk wrote: Hi Nicholas, IIRC the hatch isn't in the Tardis

Re: Dear Dr Who experts...

2014-10-09 Thread Roger Bell_West
On Wed, Oct 08, 2014 at 09:11:05PM +0200, Joel Bernstein wrote: Are the films not considered canonical? Even for a show so utterly free of consistency as _Doctor Who_, the films are not considered canonical.

Re: Dear Dr Who experts...

2014-10-09 Thread Sam Kington
Doesn't the plot of one of the 1960s films hinge on the Daleks not being able to levitate though? Bit inconsistent. Are the films not considered canonical? No. (The wikipedia article itself says The film was not intended to form part of the ongoing storylines of the television series. and

Re: Getting the latest related record from a SQL DB

2014-10-09 Thread Gianni Ceccarelli
I think you want a window function (see for example http://www.postgresql.org/docs/9.1/static/tutorial-window.html ) Something like: SELECT name,title FROM ( SELECT artist.name,album.title,rank() OVER ( PARTITION BY artist.id ORDER BY album.date DESC ) as r FROM artist JOIN

RE: Getting the latest related record from a SQL DB

2014-10-09 Thread Adam Witney
I'm after some best-practice advice regarding SQL database design. I have a table (say artist, couldn't resist...) that has a one-to-many relationship to another table (say album). The album table has a field which references the artist table's ID. So one artist can have many albums. So,

RE: Getting the latest related record from a SQL DB

2014-10-09 Thread Rob Lucas
Something like this? Doesn't use a join etc, but has the merit of simplicity. SELECT * FROM Artist, Album WHERE Artist.Id = $artist_id AND Album.ArtistId = $artist_id ORDER BY album.date DESC LIMIT 1? R -Original Message- From: london.pm-boun...@london.pm.org

Re: Getting the latest related record from a SQL DB

2014-10-09 Thread Denny
On Thu, 2014-10-09 at 13:28 +0100, Andrew Beverley wrote: what if I want to fetch an artist's details and his latest album? I can select the artist from the artists table and then join the albums table. But to get the latest album I'd have to use a max function (say on the album's date), with

Re: Getting the latest related record from a SQL DB

2014-10-09 Thread Gareth Harper
In general I guess it's cleaner to do: SELECT * FROM artist WHERE id = ? SELECT * FROM album WHERE artist_id = ? ORDER BY release_date DESC LIMIT 1 OR SELECT * from artist INNER JOIN album ON (artist.id = album.artist_id) ORDER BY album.release_date DESC LIMIT 1 - Gareth On 9 October 2014

Re: Dear Dr Who experts...

2014-10-09 Thread Schmoo
Dr Who, the famous neurologist who specialises in the study of amnesia? On 9 October 2014 14:02, Moray Jones moray.jo...@gmail.com wrote: You're all making a very common error - it's not Dr Who, it's Mr Who. I remember it from Trivial Pursuit. Or was that something to do with Star Trek...can

Re: Getting the latest related record from a SQL DB

2014-10-09 Thread Mark Fowler
On Thu, Oct 9, 2014 at 8:28 AM, Andrew Beverley a...@andybev.com wrote: Neither seem particularly tidy to me, so am I missing something completely obvious? CREATE TEMP TABLE artist ( id INTEGER, name TEXT ); CREATE TEMP TABLE album ( id INTEGER, artist INTEGER, name TEXT, release_date

Re: Dear Dr Who experts...

2014-10-09 Thread Chris Jack
From: Joel Bernstein wrote: I think I meant this film: http://en.wikipedia.org/wiki/Dr._Who_and_the_Daleks Bernard Cribbins was the heroic lead in the sequel - which, AFAIK, makes him the only major character actor to appear in both the parallel universe of the Cushing movies and the main

Re: Getting the latest related record from a SQL DB

2014-10-09 Thread Jonathan McKeown
On 9 Oct 2014 18:34, Andrew Beverley a...@andybev.com wrote: Hi guys, I'm after some best-practice advice regarding SQL database design. SWAG (swift wild-arsed guess) rather than best practice [snip] So, if I want to know all of an artist's albums, that's easy. But what if I want to

Re: Getting the latest related record from a SQL DB

2014-10-09 Thread Jonathan McKeown
ORDER BY date DESC - not DESCENDING

Re: Dear Dr Who experts...

2014-10-09 Thread Dave Cross
On 08/10/14 20:11, Joel Bernstein wrote: Are the films not considered canonical? The two films aren't canonical. They are loose remakes of the first two Dalek stories from the TV series. With Peter Cushing playing a human inventor called Doctor Who. Dave...

Re: Getting the latest related record from a SQL DB

2014-10-09 Thread Paul Makepeace
Why not include a sub-select like, ... where album.published = (select max(album.published) from album join artist on album.artist_id = artist.id) ... Paul On Thu, Oct 9, 2014 at 5:28 AM, Andrew Beverley a...@andybev.com wrote: Hi guys, I'm after some best-practice advice regarding SQL