This is exactly what I was looking for. It works perfectly. Thanks, -- Bill Drago Senior Engineer L3 Communications / Narda Microwave East 435 Moreland Road Hauppauge, NY 11788 631-272-5947 / william.dr...@l-3com.com
> -----Original Message----- > From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users- > boun...@sqlite.org] On Behalf Of Igor Tandetnik > Sent: Tuesday, November 04, 2014 5:49 PM > To: sqlite-users@sqlite.org > Subject: Re: [sqlite] How to check if a record exists > > On 11/4/2014 4:47 PM, Drago, William @ CSG - NARDAEAST wrote: > > "SELECT count(1) DatasetID FROM UUT_Info > > where DatasetID = " + id + ";"; > > You could do > > select exists (select 1 from UUT_Info where DatasetID = :id); > > This returns 0 or 1 (record absent/present). May work faster than the > variant using count() if there are many records satisfying the > condition (EXISTS stops as soon as it finds the first matching record), > but that may not be a consideration in your case (DatasetID sounds like > primary key). > -- > Igor Tandetnik > > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users CONFIDENTIALITY, EXPORT CONTROL AND DISCLAIMER NOTE:This e-mail and any attachments are solely for the use of the addressee and may contain information that is privileged or confidential. Any disclosure, use or distribution of the information contained herein is prohibited. In the event this e-mail contains technical data within the definition of the International Traffic in Arms Regulations or Export Administration Regulations, it is subject to the export control laws of the U.S.Government. The recipient should check this e-mail and any attachments for the presence of viruses as L-3 does not accept any liability associated with the transmission of this e-mail. If you have received this communication in error, please notify the sender by reply e-mail and immediately delete this message and any attachments. _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users