Re: TOAD doesn't like FOR statement?
Wendy Penfold <[email protected]>
| Newsgroups | gmane.comp.db.oracle.toad.free |
|---|---|
| Message-ID | <[email protected]> |
Yes, I checked and the sql statement returns the same number of rows regardless of whether DISTINCT is used, so I removed it. On 10/11/2011 2:57 AM, Dunbar, Norman (Capgemini) wrote: > > Morning Bert, > > >> Also you might like to replace the select distinct (bad > >> practice) with a subquery using exists or not exists - which > >> generally (although version dependent) perform better - i.e. > >> better plans > I was thinking about the SELECT DISTINCT as well. Mainly because there > is no chance that there will be a data set containing any > owner.table_name.column_name that would be duplicated, regardless of > the comments. > > Mind you, I always think about the SELECT DISTINCTs when I see them. I > spent 18 months trying to educate a third party who simply used SELECT > DISTINCT every time - but in the form: > > SELECT DISTINCT (Something), something_else, ... > > thinking - if I can use the word, that only the SOMETHING column would > be distinct! :-( > > Cheers, > Norm. [TeamT] > > Norman Dunbar > Contract Senior Oracle DBA > Capgemini Database Build Team > Internal : 7 28 2051 > External : 0113 231 2051 > > Information in this message may be confidential and may be legally > privileged. If you have received this message by mistake, please > notify the sender immediately, delete it and do not copy it to anyone > else. > > We have checked this email and its attachments for viruses. But you > should still check any attachment before opening it. > We may have to make this message and any reply to it public if asked > to under the Freedom of Information Act, Data Protection Act or for > litigation. Email messages and attachments sent to or from any > Environment Agency address may also be accessed by someone other than > the sender or recipient, for business purposes. > > If we have sent you information and you wish to use it please read our > terms and conditions which you can get by calling us on 08708 506 506. > Find out more about the Environment Agency at > www.environment-agency.gov.uk > >