ciao a tutti io ho una situazione di questo genere:
campi:
shipping_email
billing_email
shipping_notes
billing_notes
voglio estrarre tutte le email nei 2 campi senza doppioni.
ho fatto
codice:
"SELECT DISTINCT (shipping_email,billing_email),shipping_notes, billing_notes FROM ORDERS WHERE billing_notes LIKE '%-" & cs1 & "-%' OR billing_notes LIKE '%-" & cs2 & "-%' OR shipping_notes LIKE '%-" & cs1 & "-%' OR shipping_notes LIKE '%-" & cs2 & "-%' "
non funziona penso per il fatto che non si possono mettere 2 campi in per la distinct.
ho provato anche con il GROUP BY:
codice:
"SELECT shipping_email,billing_email,shipping_notes, billing_notes FROM ORDERS WHERE billing_notes LIKE '%-" & cs1 & "-%' OR billing_notes LIKE '%-" & cs2 & "-%' OR shipping_notes LIKE '%-" & cs1 & "-%' OR shipping_notes LIKE '%-" & cs2 & "-%' GROUP BY shipping_email,billing_email"
ma mi da errore perche i 2 campi notes non sono inclusi e se li includo non li raggruppa.
Come posso procedere?