----- Original Message ----- From: Steve Howard <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Sunday, July 08, 2001 4:47 AM Subject: RE: Checking for the existence of a certain row. > OK, one more yes-no. I tried this for performance and as expected, it is > faster than count on MS and Sybase (and count is very fast on MS). You might > see if there is a variation of it you can use with the Oracle Decode > function....I can't answer if there is or not, however in either case even > though this is probably faster, it won't be portable between some dbms's. > > SELECT CASE > WHEN EXISTS(SELECT somecolumn FROM customers WHERE columnname ='thisvalue') > then 1 > ELSE 0 > END > You could also issue a: select count(keyfield) from sometable where someclause I did some benchmarks and found that is was faster then a where exists. Maarten.
- Checking for the existence of a certain row. James Kufrovich
- Re: Checking for the existence of a certain row. Mark Thornber
- Re: Checking for the existence of a certain row. Steven Lembark
- RE: Checking for the existence of a certain row. Steve Howard
- RE: Checking for the existence of a certain row. Steven Lembark
- Re: Checking for the existence of a certain row... Peter J . Holzer
- Re: Checking for the existence of a certain row. Thomas A . Lowery
- RE: Checking for the existence of a certain row. Tim Harsch
- RE: Checking for the existence of a certain row. Steve Howard
- Re: Checking for the existence of a certain row. M.W. Koskamp
- Re: Checking for the existence of a certain row... James Kufrovich
- Re: Checking for the existence of a certain row. Thomas A . Lowery
- RE: Checking for the existence of a certain row. Tim Harsch
- Re: Checking for the existence of a certain row. Michael A. Chase
- Re: Checking for the existence of a certain row... Peter J . Holzer
- Re: Checking for the existence of a certain row. M.W. Koskamp
- RE: Checking for the existence of a certain row. Tim Harsch
- Re: Checking for the existence of a certain row... Peter J . Holzer
- RE: Checking for the existence of a certain row. Dan Hopkins
- Re: Checking for the existence of a certain row. Ronald J Kimball