how to skip some row

Discussion in 'PHP' started by hexmax, Dec 19, 2010.

  1. #1
    Hi

    i Need to query but skip some row's

    like this

    select * from mytable

    but i want query skip rows id (2.5.6.7.8.9)
    or skip array value

    can any one help with this ?
     
    hexmax, Dec 19, 2010 IP
  2. tvoodoo

    tvoodoo Active Member

    Messages:
    239
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    53
    #2
    Try this query :
    SELECT * FROM mytable WHERE ID NOT IN (2,5,6,7,8,9)

    To select the rows that don't have the ids you don't want to show.
     
    tvoodoo, Dec 19, 2010 IP
  3. xpertdev

    xpertdev Peon

    Messages:
    54
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    SELECT * from table WHERE id NOT IN(2,6,9,10);
     
    xpertdev, Dec 20, 2010 IP