Avatar of danz67
danz67
Flag for Italy asked on

MYSQL . Query select

hi,
I would like to change this query,
I need to see the DESCRIZIONE field that is in the ARTICOLI table

SELECT A.IDARTICOLO,
       A.TAGLIA,
       A.COLORE,
       A.QUANTITA
FROM CARICOTCDOC  A
LEFT OUTER JOIN VENDUTI B ON A.IDARTICOLO  = B.IDARTICOLO
WHERE B.IDARTICOLO IS NULL

Open in new window

MySQL Server

Avatar of undefined
Last Comment
Kevin Cross

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Pratima

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
danz67

ASKER
pratima_mcs:

works well, I would avoid repeating data, perhaps we need a grouping?
Kevin Cross

If the data was not repeating before pratima_mcs's suggestion that simply means you need to find a more unique JOIN criteria to ARTICOLI.  What column(s) in that table uniquely match it to a row in CARICOTCDOC?  If the data was repeating before, then you may be able to use GROUP BY or SELECT DISTINCT.  With the former, you will need to determine what to do with other values, i.e., how to aggregate them.  It is always best to find why rows are duplicated in the first place to avoid unnecessary GROUP BY/DISTINCT usage.
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck