SQLize Online / PHPize Online

A A A
Share   Donate   Blog   Popular
Copy Format Clear
CREATE TABLE prodotti( code int, descri varchar (255), note varchar (255) ); INSERT INTO prodotti (code, descri, note) VALUES (01, 'ChitarraAcustica', 'NonAmplificabile'), (01, 'ChitarraAcustica', 'Amplificabile'), (02, 'ChitarraElettrica', 'SuonoPulito'), (02, 'ChitarraElettrica', 'SuonoDistorto'), (03, 'ChitarraClassica', 'PerfettaPerArpeggi'); SELECT code, descri, note FROM prodotti ORDER BY code; SELECT code, COUNT(*) as descri FROM prodotti GROUP BY code; SELECT code, descri, COUNT (*) as Nr FROM prodotti GROUP BY code, descri HAVING count (*) >1 SELECT DISTINCT code FROM prodotti; SELECT p.code, p.descri, p.note FROM prodotti P JOIN ( SELECT code, descri, COUNT (*) as Numero FROM prodotti GROUP BY code, descri HAVING COUNT(*) >1 )r ON p.code = r.code and p.descri = r.descri
Stuck with a problem? Need help? Ask professionals on our Telegram channel!
Join the channel
Your quersion is posted.
Join our Telegram channel and get answers.
Send
Copy