SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Addict AdRock952's Avatar
    Join Date
    Aug 2006
    Posts
    243
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    SELECT * WHERE field NOT IN ('field ')

    I am trying to get all records except a particluar record.

    I have got it to work, but if i try to order it by id or something, it goes tits up.
    Code SQL:
    SELECT id,title, content, USER, DATE_FORMAT(DATE, '%d/%m/%y %H.%i') AS DATE FROM services WHERE title NOT IN ('Welcome!!') ORDER BY id ASC LIMIT 1, 4

  2. #2
    SitePoint Addict AdRock952's Avatar
    Join Date
    Aug 2006
    Posts
    243
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Fixed

  3. #3
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,273
    Mentioned
    60 Post(s)
    Tagged
    3 Thread(s)
    Quote Originally Posted by AdRock952 View Post
    Fixed
    how?
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  4. #4
    SitePoint Wizard guelphdad's Avatar
    Join Date
    Oct 2003
    Location
    St. Catharines, ON Canada
    Posts
    1,708
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's obvious Rudy, by moving the grapplegrommit over next to the thingamajig! I'm surprised you didn't see that.

  5. #5
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,273
    Mentioned
    60 Post(s)
    Tagged
    3 Thread(s)
    actually, to be honest, i had never heard of grapplegrommit before

    i would've added it to my table of items (Appendix C, page 279):
    Code:
    CREATE TABLE items
    ( id     INTEGER      NOT NULL PRIMARY KEY
    , name   VARCHAR(21)  NOT NULL
    , type   VARCHAR(7)   NOT NULL
    , price  DECIMAL(5,2)   NULL
    );
    INSERT INTO items VALUES (5021,'thingie'        ,'widgets',  9.37 );
    INSERT INTO items VALUES (5022,'gadget'         ,'doodads', 19.37 );
    INSERT INTO items VALUES (5023,'dingus'         ,'gizmos' , 29.37 );
    INSERT INTO items VALUES (5041,'gewgaw'         ,'widgets',  5.00 );
    INSERT INTO items VALUES (5042,'knickknack'     ,'doodads', 10.00 );
    INSERT INTO items VALUES (5043,'whatnot'        ,'gizmos' , 15.00 );
    INSERT INTO items VALUES (5061,'bric-a-brac'    ,'widgets',  2.00 );
    INSERT INTO items VALUES (5062,'folderol'       ,'doodads',  4.00 );
    INSERT INTO items VALUES (5063,'jigger'         ,'gizmos' ,  6.00 );
    INSERT INTO items VALUES (5901,'doohickey'      ,'widgets', 12.00 );
    INSERT INTO items VALUES (5902,'gimmick'        ,'doodads',  9.37 );
    INSERT INTO items VALUES (5903,'dingbat'        ,'gizmos' ,  9.37 );
    INSERT INTO items VALUES (5911,'thingamajig'    ,'widgets', NULL  );
    INSERT INTO items VALUES (5912,'thingamabob'    ,'doodads', NULL  );
    INSERT INTO items VALUES (5913,'thingum'        ,'gizmos' , NULL  );
    INSERT INTO items VALUES (5931,'contraption'    ,'widgets', 49.95 );
    INSERT INTO items VALUES (5932,'whatchamacallit','doodads', 59.95 );
    INSERT INTO items VALUES (5937,'whatsis'        ,'gizmos' , NULL  );
    Off Topic:

    anyhow i wanted to get some etymology for this gorgeous word, grappelgrommit, so i googled it, and there you are using it on codingforums yesterday!
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  6. #6
    SitePoint Wizard guelphdad's Avatar
    Join Date
    Oct 2003
    Location
    St. Catharines, ON Canada
    Posts
    1,708
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hmm, I just googled it, seems it can be two words or hyphenated too! Note I got a smart *** answer on codingforums too!

    I remember some TV commercial way back when and the guy's factory made widgets and grapple gromits or whatever. So I've used it since then. Can't say I remember more about the commercial (i.e. the product)

    OFFTOPIC: how come you can say a four letter word for a small bird like in the original post in this thread, but can't say a three letter word for donkey/mule's cousin?

  7. #7
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,273
    Mentioned
    60 Post(s)
    Tagged
    3 Thread(s)
    how come?

    by canoe



    it's a bot -- just outsmart it

    as for the original post, it was dodgy and borderline, but so far no moderator has done anything about it, eh

    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
  •