SQL algoritm ?
Cum se poate de unit 2 selecturi in unul singur ?Primul select selecteaza 2 cimpuri dupa careva criterii, si al 2 tot aceleasi 2 cimpuri dupa alt criteriu din acelas tabel!Cum se poate de unificat cimpuriule selectate astfel incit valorile care se repeta sa se grupeze dupa acelas cod:SQL sciptrurile sunt :1.select (select u.denumirea from vms_univers u where u.cod=ctsc) produs,(select u.cod from vms_univers u where u.cod=ctsc) codprodus,sum(cant) cantprihod,sum(suma) sumaprihod,from vmdb_cmi where dtdep=80 and data between '07.10.2008' and '16.10.2008'group by ctsc2. select (select u.denumirea from vms_univers u where u.cod=ctsc) produs,(select u.cod from vms_univers u where u.cod=ctsc) codprodus,sum(cant) cantrashod,sum(suma) sumarashod from vmdb_cmi,vmdb_docs d where d.cod = nrdoc and d.sysfid in (44008) and(((dt=2211 OR dt=2212 OR dt=5311) AND (ct BETWEEN 6111 AND 6115 OR ct=5342 OR ct = 5347))OR (dt=9242)) anddata between '16.10.2008' and '16.10.2008'group by ctsc... ??? ...