List:General Discussion« Previous MessageNext Message »
From:Blog Tieng Viet Date:December 3 2011 4:41pm
Subject:How to get a specific number of entries per one key ?
View as plain text  
Hellow everybody.

I have a problem difficult for me, please give me an advice.

I want to get a specific number of entry (rows) from a table 
by each Key. If the number is 1, I can use "select dinstinct",
but the number is not 1, I don't know how to select.

For example:

Key 0 | data 0-0
Key 0 | data 0-1
Key 0 | data 0-2
Key 1 | data 1-0
Key 1 | data 1-1

I want to select 2 data for each key.
Key 0 (data 0-0, data 0-1), Key 1 (data 1-0, data 1-1).

How to describe in query ?

Best regards.


--- On Sat, 12/3/11, Govinda <govinda.webdnatalk@stripped> wrote:

> From: Govinda <govinda.webdnatalk@stripped>
> Subject: Re: delete syntax
> To: 
> Cc: mysql@stripped
> Date: Saturday, December 3, 2011, 6:43 AM
> >> 
> >>> well, i am using delete/insert-statements
> since 10 years to maintain
> >>> users since you only have to know the tables
> in the database "mysql"
> >>> and use "flush privileges" after changes
> >>> 
> >>> The privileges should be maintained  only
> using the designated commands.
> >> You cannot rely on the knowledge you have of the
> underlying implementation
> >> which can change anytime , while the privileges
> command are standard.
> > 
> > do what you think is good for you if YOU can't be sure
> what you do
> > [snip]
> > so please do not tell other peopole on what knowledge
> they can rely
> > 
> 
> 
> *all* the back and forth in these threads is good.. is
> susses out all the knowledge for everyone to see.
> Sincerely thanks to everyone who chimes in from all
> perspectives,
> -Govinda
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    http://lists.mysql.com/mysql
> 
> 
Thread
delete syntaxTim Dunphy2 Dec
  • Re: delete syntaxKrishna Chandra Prajapati2 Dec
    • Re: delete syntaxTim Dunphy2 Dec
      • Re: delete syntaxShiva2 Dec
        • Re: delete syntaxReindl Harald2 Dec
          • Re: delete syntaxStdranwl2 Dec
            • Re: delete syntaxReindl Harald2 Dec
              • Re: delete syntaxClaudio Nanni2 Dec
                • Re: delete syntaxReindl Harald2 Dec
                  • Re: delete syntaxGovinda2 Dec
                    • How to get a specific number of entries per one key ?Blog Tieng Viet3 Dec
                      • Re: How to get a specific number of entries per one key ?Arthur Fuller3 Dec
                        • Re: How to get a specific number of entries per one key ?Rik Wasmus5 Dec
    • Re: delete syntaxKeith Keller2 Dec