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
non funziona penso per il fatto che non si possono mettere 2 campi in per la distinct.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 & "-%' "
ho provato anche con il GROUP BY:
ma mi da errore perche i 2 campi notes non sono inclusi e se li includo non li raggruppa.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"
Come posso procedere?

Rispondi quotando