Project / Support Center
Welcome, Guest. Please login or register. November 28, 2023, 08:24: PM
Home Help Search Login Register
D-Web Web Site Creator D - Web Web Site Creator On-line HTML Editor No Programming knowledge required. Web Global Net PayPal-Cart Shopping Cart System PayPal - Kart Shopping Cart System for E-Commerce over the internet, that's easy to use. Web Global Net Newsletter Manager Newsletter Manager On-line Newsletter Creator with Email Subscriber Management.
Ring Central Discount
Web Global Net Web Application & Web Development Project Center  |  Technical Issues  |  MySQL  |  Topic: Showing the distinct values in a field 0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Go Down Send this topic Print
Author Topic: Showing the distinct values in a field  (Read 3182 times)
admin
Administrator
******
Offline Offline

Posts: 239


« on: January 26, 2022, 11:09: PM »

if you have a field that show certain values multiple times yet you only want to know those values not all of the same values in the field then use the SELECT DISTINCT

lets say you have 10 records in a table have a column field - category and in that field 5 are RED and 5 are Blue values and you want a list of the type of values used then use the SELECT DISTINCT  to show you just the different values - Red or Blue in the category field and not list all the values

SELECT DISTINCT category (this is the field)
FROM models (this is the table)


SELECT DISTINCT it_sub_cat_name
FROM it_sub_category
ORDER BY it_category_id ASC

is how you'd write the mysql
« Last Edit: May 19, 2023, 07:19: PM by admin » Report to moderator   Logged

The Unknown Webmaster
Pages: [1] Go Up Send this topic Print 
Web Global Net Web Application & Web Development Project Center  |  Technical Issues  |  MySQL  |  Topic: Showing the distinct values in a field « previous next »
Jump to:  


Login with username, password and session length
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!