1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
SQL> accept date_deb prompt 'Saisir la date de début de période (jjmmaaaa) : '
Saisir la date de début de période (jjmmaaaa) : 20150101
SQL> accept date_fin prompt 'Saisir la date de fin de période (jjmmaaaa) : '
Saisir la date de fin de période (jjmmaaaa) : 20150201
SQL > select code1, libcode1 , code2 , refcode2 , libcode2, round(sum(duree)/60,2) as duree_minute_vers_heure, TO_DATE(madate,'WW') as semaine
from tab1
left join tab2 on tab1.code1=tab2.code1
left join tab3 on tab1.code2=tab3.code2
where acvdtd_aag between &date_deb and &date_fin
and libcode1 LIKE 'toto%'
group by code1, libcode1 , code2 , refcode2ref , libcode2,TO_DATE(madate,'WW');
select code1, libcode1 , code2 , refcode2 , libcode2, round(sum(duree)/60,2) as duree_minute_vers_heure, TO_DATE(madate,'WW') as semaine
from tab1
left join tab2 on tab1.code1=tab2.code1
left join tab3 on tab1.code2=tab3.code2
where acvdtd_aag between 20150101 and 20150201
and libcode1 LIKE 'toto%'
SQL>
erreur ligne 6 : ERROR ORA-00932: inconsistent datatypes: expected DATE got NUMBER
SQL>
group by code1, libcode1 , code2 , refcode2ref , libcode2,TO_DATE(madate,'WW'); |
Partager