Is this the most efficient way...?
#3

Theoretically, this should work: (credits)

Код:
SELECT COUNT('Email Address') AS NumOccurrences FROM Accounts HAVING ( COUNT(NumOccurrences) >= 1 )
(If that doesn't work, it's because of the two speech marks in the COUNT area, it works fine if you use one word without speech marks.)

You can just return the result, 0 if no, higher (or equal) 1 if so.

Also, a little tip: It's really not wise to use spaces for column names, it's more problematic. Use camel case.

Oh yeah, this code will only check replicates in the database already, not what criteria you specify.
Reply


Messages In This Thread
Is this the most efficient way...? - by Scenario - 18.12.2011, 02:39
Re: Is this the most efficient way...? - by [HiC]TheKiller - 18.12.2011, 02:45
Re: Is this the most efficient way...? - by Calgon - 18.12.2011, 02:47
Re: Is this the most efficient way...? - by Scenario - 18.12.2011, 02:54
Re: Is this the most efficient way...? - by Calgon - 18.12.2011, 02:59
Re: Is this the most efficient way...? - by Scenario - 18.12.2011, 03:01
Re: Is this the most efficient way...? - by Calgon - 18.12.2011, 03:04
Re: Is this the most efficient way...? - by Scenario - 18.12.2011, 03:06
Re: Is this the most efficient way...? - by Lorenc_ - 18.12.2011, 03:06
Re: Is this the most efficient way...? - by jamesbond007 - 18.12.2011, 03:18

Forum Jump:


Users browsing this thread: 1 Guest(s)