in reply to Checking for Dupes in MySQL
Many good suggestions concerning unique.
Another technique is available for checking whether a given value appears in a column, without any needing to fetch any data from your backend, and that is:
select 1 from mytable where mycol='foo'
You'll either get a row back, or nothing. In the general case, this is about as cheap as it gets.
--
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Checking for Dupes in MySQL
by Ryszard (Priest) on Nov 30, 2001 at 03:42 UTC |