SELECT dc.article as "Артикул", c.name as "Наименование" FROM supermag.smdocuments d, supermag.smspec dc, supermag.smcard c WHERE d.doctype=dc.doctype AND d.id=dc.docid AND c.article=dc.article AND c.accepted = 1 AND d.doctype='WI' AND d.docstate>1 AND TO_DATE(d.createdat) BETWEEN ('%DATE1%') AND ('%DATE2%') AND d.clientindex = (%VEN%) GROUP BY dc.article, c.name ORDER BY c.name
Connected to Oracle9i Enterprise Edition Release 9.2.0.7.0 Connected as supermag SQL> SQL> define date1='10.10.2007' SQL> define date2='10.10.2007' SQL> define ven=181 SQL> alter session set cursor_sharing=EXACT; Session altered SQL> SELECT dc.article as "Артикул", 2 c.name as "Наименование" 3 FROM supermag.smdocuments d, 4 supermag.smspec dc, 5 supermag.smcard c 6 WHERE d.doctype=dc.doctype 7 AND d.id=dc.docid 8 AND c.article=dc.article 9 AND c.accepted = 1 10 AND d.doctype='WI' 11 AND d.docstate>1 12 AND TO_DATE(d.createdat) BETWEEN ('&DATE1') AND ('&DATE2') 13 AND d.clientindex = (&VEN) 14 GROUP BY dc.article, c.name 15 ORDER BY c.name 16 / Артикул Наименование -------------------------------------------------- -------------------------------------------------------------------------------- 32 rows selected SQL> alter session set cursor_sharing=SIMILAR; Session altered SQL> SELECT dc.article as "Артикул", 2 c.name as "Наименование" 3 FROM supermag.smdocuments d, 4 supermag.smspec dc, 5 supermag.smcard c 6 WHERE d.doctype=dc.doctype 7 AND d.id=dc.docid 8 AND c.article=dc.article 9 AND c.accepted = 1 10 AND d.doctype='WI' 11 AND d.docstate>1 12 AND TO_DATE(d.createdat) BETWEEN ('&DATE1') AND ('&DATE2') 13 AND d.clientindex = (&VEN) 14 GROUP BY dc.article, c.name 15 ORDER BY c.name 16 / Артикул Наименование -------------------------------------------------- -------------------------------------------------------------------------------- 32 rows selected SQL> alter session set cursor_sharing=FORCE; Session altered SQL> SELECT dc.article as "Артикул", 2 c.name as "Наименование" 3 FROM supermag.smdocuments d, 4 supermag.smspec dc, 5 supermag.smcard c 6 WHERE d.doctype=dc.doctype 7 AND d.id=dc.docid 8 AND c.article=dc.article 9 AND c.accepted = 1 10 AND d.doctype='WI' 11 AND d.docstate>1 12 AND TO_DATE(d.createdat) BETWEEN ('&DATE1') AND ('&DATE2') 13 AND d.clientindex = (&VEN) 14 GROUP BY dc.article, c.name 15 ORDER BY c.name 16 / Артикул Наименование -------------------------------------------------- -------------------------------------------------------------------------------- 32 rows selected SQL>