Un mio amico ha un problema nel completare una procedura di interrogazione su una certa tabella.
Le funzioni per estrarre i record e gestirli poi tramite interfaccia a video sono ovviamente banali, ma ha un problema con la query in quanto non gli restituisce nessun record quando invece sono sicuro che qualche risultato dovrebbe ritornarglielo..potete dare un'occhiata.. grazie.

Codice PHP:
select 
substr
(d.data_traf,1,4)||'m'||substr(d.data_traf,5,2)||'d'||substr(d.data_tr 
af
,7,2data_traffico
case 
max(d.t_contowhen 1 then 'T' when 2 then 'I' else 'N' end||
'
||case max(d.t_conto_debwhen 1 then 'T' when 2 then 'I' else 
'N' end ||' '||ifnull(tr.descr,rpad(d.v_traf||'?',20)) verso_conti 
from val_giorno
:public.val_giorno d 
loj t_ora
:w_t_v_traf tr on d.v_traf=tr.verso 
group by ifnull
(tr.descr,rpad(d.v_traf||'?',20))