Results 1 to 4 of 4

Thread: Sql

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2005
    Posts
    334

    Sql

    Select * from Items where store = "cbochoice"

    how do i change the above query so that it returns all columns from items table BUT does not repeat a ItemID more than once.... the primary key in this table is the temID AND the Itemsize

  2. #2
    Addicted Member
    Join Date
    Jul 2002
    Location
    UK
    Posts
    147

    Re: Sql

    SELECT DISTINCT ItemID AS Expr1, * from Items where store = "cbochoice"
    Mik706

  3. #3
    Frenzied Member moinkhan's Avatar
    Join Date
    Jun 2000
    Location
    Karachi, Pakistan
    Posts
    2,011

    Re: Sql

    Quote Originally Posted by pame1la
    Select * from Items where store = "cbochoice"

    how do i change the above query so that it returns all columns from items table BUT does not repeat a ItemID more than once.... the primary key in this table is the temID AND the Itemsize
    select max(itemid) from items where store ="cbochoice"
    group by itemid

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Sql

    Which ever of the above choices works best for you, you probably want to slightly amend your statment to include single quotes around your combo box entry.
    VB Code:
    1. ...FROM Items WHERE store = '" & cbochoice & "'"

Posting Permissions

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



Click Here to Expand Forum to Full Width