Originariamente inviato da nicola75ss
Puoi fare un esempio pratico di ciò che vuoi ottenere?
Grazie, ci provo.
codice:
select substring_index(line,'-',1) as radice,
sum(if(dove=1,1,0)) as line_a,
sum(if(dove=2,1,0)) as line_b,
count(substring_index(line,'-',1)) as quanti from (
select line, 1 as dove_b from tabella_b
union all
select line_mt, 2 as dove_a from tabella_a
) as tab
group by radice
having quanti > 3
response.write RS("radice") & " = " & RS("quanti") & " ===> " &_
"tot A = " & RS("dove_b") & " ; tot B = " & RS("dove_a") & "
"
Questo è l'output:
codice:
DM4047608 = 33 ===> tot A = 29 ; tot B= 4
Ad ogni radice è associato in tabella A un campo che si chiama zn, dovrei avere un output del tipo:
codice:
zn = ????? ===> DM4047608 = 33 ===> tot A = 29 ; tot B= 4
Ma il campo zn esiste solo in tabella A e NON in tabella B.
Mi segui?