Re: [SQL] sub-limiting a query

2007-02-17 Thread Louis-David Mitterrand
On Sat, Feb 17, 2007 at 07:21:40PM +0100, M.P.Dankoor wrote: > Louis-David Mitterrand wrote: > > > I thought of another solution, actually it's of those top n query tricks > that I picked up somewhere, can't remember > where. > Assuming that your table is called shows, the following query should

Re: [SQL] sub-limiting a query

2007-02-17 Thread M.P.Dankoor
Louis-David Mitterrand wrote: Hello, I've got a table of shows with different types (movie, theater, ballet,etc.) and I am looking for a select that can return the 10 last entered shows AND at most 2 of each type. Is that possible in one query? The table looks basically like: created_on

Re: [SQL] sub-limiting a query

2007-02-17 Thread Andreas Kretschmer
Louis-David Mitterrand <[EMAIL PROTECTED]> schrieb: > ballet,etc.) and I am looking for a select that can return the 10 last > entered shows AND at most 2 of each type. Is that possible in one query? A similar question i found in the archive and there are a couple of answers: (for the second par

Re: [SQL] sub-limiting a query

2007-02-17 Thread M.P.Dankoor
Louis-David Mitterrand wrote: Hello, I've got a table of shows with different types (movie, theater, ballet,etc.) and I am looking for a select that can return the 10 last entered shows AND at most 2 of each type. Is that possible in one query? The table looks basically like: created_on

Re: [SQL] sub-limiting a query

2007-02-17 Thread A. Kretschmer
am Sat, dem 17.02.2007, um 13:56:35 +0100 mailte Louis-David Mitterrand folgendes: > Hello, > > I've got a table of shows with different types (movie, theater, > ballet,etc.) and I am looking for a select that can return the 10 last > entered shows AND at most 2 of each type. Is that possible

[SQL] sub-limiting a query

2007-02-17 Thread Louis-David Mitterrand
Hello, I've got a table of shows with different types (movie, theater, ballet,etc.) and I am looking for a select that can return the 10 last entered shows AND at most 2 of each type. Is that possible in one query? The table looks basically like: created_on | timestamp without tim