FW: [Cialug] SQL wizardry possible?

Matthew Nuzum newz at bearfruit.org
Wed Oct 31 14:23:53 CDT 2007


On 10/31/07, murraymckee at wellsfargo.com <murraymckee at wellsfargo.com> wrote:
> Creating a view will still result in the query running 3 times.
>
> Create TEMP_DELETES Table as <BIG MESS>;
>
> delete from turba_objects where turba_objects.owner_id in
> TEMP_DELETES.owner_ID; =>
> delete from horde_histories where history_who in TEMP_DELETES.owner_ID;
> =>
> delete from horde_prefs where pref_uid in TEMP_DELETES.owner_ID;
>
> Drop table TEMP_DELETES;

Nice! My goal was to save some typing, and it achieved that. Your
solution not only saves the typing but is far more efficient and may
even benefit from indexing.

-- 
Matthew Nuzum
newz2000 on freenode


More information about the Cialug mailing list