Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 913377
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T17:32:51+00:00 2026-05-15T17:32:51+00:00

I have a database with 3 columns (item_number, seller_id, type) . I’m getting the

  • 0

I have a database with 3 columns (item_number, seller_id, type) .
I’m getting the columns content using while loop.

$sql = msql_query("SELECT * FROM item_detals WHERE type='classifiedTitlePrice'");
while($row = mysql_fetch_array($sql)) {
    $item_number = $row['item_number'];
    $mcat = $row['mcat'];
}

However the problem is that a seller_id may have more items(e.g example_seller => 1234 , example_seller =>55555) so I would like to know if it’s possible to get only an a combination of item_number & seller_id which has the same seller_id .So basically if there will be example_seller => 1234 , example_seller =>55555 the query should get only the 1st (or last) combination of seller_id => item_number.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T17:32:53+00:00Added an answer on May 15, 2026 at 5:32 pm

    Try GROUP BY or DISTINCT

    http://dev.mysql.com/doc/refman/5.1/en/group-by-functions.html

    http://dev.mysql.com/doc/refman/5.1/en/distinct-optimization.html

    SELECT item_number, seller_id 
    FROM item_detals 
    WHERE type='classifiedTitlePrice' 
    GROUP BY `seller_id`
    

    or

    SELECT item_number, DISTINCT seller_id 
    FROM item_detals 
    WHERE type='classifiedTitlePrice'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table in my Postgres database with columns named type, desc, and
I have a SQL Mobile database with one table. It has several columns with
I have a database table named call with columns call_time, location, emergency_type and there
I have a database that has four columns like this level_1, level_2, level_3, level_4
If I have a database containing only varchar columns, with strings encoded in Latin-1
I have two tables in my database: NEWS table with columns: id - the
In my database, I have a few columns in one of my tables that
I've just come across a database where all the character based columns have their
I'm new to database indexing, if I have 2 columns in a table that
I'm using Python/SQLite for accessing database. After running the query, and getting the result,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.