Usually, when you are asking these kind of questions, you come to realize
you are asking the wrong question.
On Monday, July 23, 2012 3:15:14 PM UTC-7, Mark Li wrote:
>
> I have a database setup with id and 'dogname.' I would like to retrieve
> distinct values of dogname, but allow for 2 of each
I have only seen complex queries to solve this. The sql can differ
according to the DB.
Example for SQL Server:
http://archive.msdn.microsoft.com/SQLExamples/Wiki/View.aspx?title=SelectTopNByGroup
Sometimes grabbing more data than you need and then discarding it is
quicker and easier than
I'll be looping over them for now, is there anyway to use a query or
select() to return a set with no more than 2 of each name?
On Monday, July 23, 2012 3:43:38 PM UTC-7, villas wrote:
>
> I can't see how distinct would help there because it only returns unique
> rows.
>
> I would say that the m
I can't see how distinct would help there because it only returns unique
rows.
I would say that the main question is how much data you have. I mean, it
is probably easier to grab all the data and then discard (or simply loop
over) the data you do not need. However, if you have a huge number
4 matches
Mail list logo