Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/wgn/public_html/support/Sources/Load.php(225) : runtime-created function on line 3

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/wgn/public_html/support/Sources/Load.php(225) : runtime-created function on line 3
Showing the distinct values in a field
Web Global Net Web Application & Web Development Project Center
March 21, 2025, 09:10: AM *

:
 
      
: [1]   
   |   
: Showing the distinct values in a field  ( 4450 )
0 1
admin
Administrator
******


: 239



« : 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
« : May 19, 2023, 07:19: PM admin »  

The Unknown Webmaster
: [1]   
   |   
 
:  

Sorry, the copyright must be in the template.
Please notify this forum's administrator that this site is missing the copyright message for SMF so they can rectify the situation. Display of copyright is a legal requirement. For more information on this please visit the Simple Machines website.