SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    Get my greedy down dotJoon's Avatar
    Join Date
    Apr 2003
    Location
    daejeon, South Korea
    Posts
    2,223
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    retrieving only 3 records

    data in myTable

    (1) Tom
    (2) Mary
    (3) Jane
    (4) Robert
    (5) Jack
    I have the above data in myTable.

    Let's look at the following code and its result.

    Code:
    code
    
    select id, name
    from myTable
    order by id
    
    result
    
    (1) Tom
    (2) Mary 
    (3) Jane
    (4) Robert
    (5) Jack

    I like to retrieve only 3 records from myTable.
    The following would-be code doesn't work correctly but it will show what I want.

    Code:
    would-be code
    
    select id, name
    limit 3
    from myTable
    order by id
    
    target result
    
    (1) Tom
    (2) Mary 
    (3) Jane

  2. #2
    reads the ********* Crier silver trophybronze trophy longneck's Avatar
    Join Date
    Feb 2004
    Location
    Tampa, FL (US)
    Posts
    9,854
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Code:
    select id, name
    from myTable
    order by id
    limit 3

  3. #3
    Get my greedy down dotJoon's Avatar
    Join Date
    Apr 2003
    Location
    daejeon, South Korea
    Posts
    2,223
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by longneck
    Code:
    select id, name
    from myTable
    order by id
    limit 3
    Thank you, longneck.

    by the way, why is your id longneck? Are you waiting someone?


    (In the culture of my country, longneck represents waiting some one, especially lover, and it develops to represent hidden beauty.)
    Last edited by dotJoon; Jun 9, 2005 at 19:02.

  4. #4
    reads the ********* Crier silver trophybronze trophy longneck's Avatar
    Join Date
    Feb 2004
    Location
    Tampa, FL (US)
    Posts
    9,854
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    no, it's derived from langanachre, which in german is roughly translated as "large landholder"
    Last edited by longneck; Jun 10, 2005 at 07:58.

  5. #5
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,350
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    Off Topic:

    german is cool my avatar is me as a kid in my lederhosen
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •