Subject | Is there more efficient SQL than UPDATE...where x in (...) |
---|---|
Author | Will Dampney |
Post date | 2005-08-11T05:36:31Z |
Hi,
I hope this is the right group for these questions, please tell me if I'm
wrong!
Can someone tell me if there is a better (more efficient) way to do this
statement in firebird:
UPDATE MBCONTACT SET PREFERRED = 0
WHERE CONTACTKEY in (select PERSONCONTACTKEY from mbpersoncontact where
PERSONKEY = :PKEY)
There is two tables, MBCONTACT contains contact detail entries (phone,
mobile, email etc) with one set as the preferred method.
The other table (MBPERSONCONTACT) links these contact entries with the
person.
The SQL above is supposed to reset the preferred contact, given the person
ID.
Without using a stored procedure, is there a better way than using the
subquery, some sort of join? The ibo query is being dynamically created in
the software.
Regards,
Will Dampney
---
Transactive Systems Pty Ltd
email: will@...
[Non-text portions of this message have been removed]
I hope this is the right group for these questions, please tell me if I'm
wrong!
Can someone tell me if there is a better (more efficient) way to do this
statement in firebird:
UPDATE MBCONTACT SET PREFERRED = 0
WHERE CONTACTKEY in (select PERSONCONTACTKEY from mbpersoncontact where
PERSONKEY = :PKEY)
There is two tables, MBCONTACT contains contact detail entries (phone,
mobile, email etc) with one set as the preferred method.
The other table (MBPERSONCONTACT) links these contact entries with the
person.
The SQL above is supposed to reset the preferred contact, given the person
ID.
Without using a stored procedure, is there a better way than using the
subquery, some sort of join? The ibo query is being dynamically created in
the software.
Regards,
Will Dampney
---
Transactive Systems Pty Ltd
email: will@...
[Non-text portions of this message have been removed]