Received: from davinci.ethosmedia.com (davinci.ethosmedia.com [209.10.40.250]) by postgresql.org (8.11.3/8.11.4) with ESMTP id g0FJA7V18274 for ; Tue, 15 Jan 2002 14:10:07 -0500 (EST) (envelope-from josh@agliodbs.com) Received: from [209.10.40.250] (account ) by davinci.ethosmedia.com (CommuniGate Pro WebUser 3.5.2) with HTTP id 620154; Tue, 15 Jan 2002 11:10:05 -0800 From: "Josh Berkus" Subject: Re: Problem with the postgresql operator. To: "KH Lim" , X-Mailer: CommuniGate Pro Web Mailer v.3.5.2 Date: Tue, 15 Jan 2002 11:10:05 -0800 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit X-Archive-Number: 200201/172 X-Sequence-Number: 6258 KH Lim, In the future, this sort of question is more appropriate for the PGSQL-NOVICE list. > What is the correct operator for not equal to in select statement? I'm a > bit confuse. > > Situation > > Let say I want to select stock_key from stock_lot with the condition > stock_lot's lot_no is not equal to stocks' lot_no. What select statement > should I use? SQL92 Standard Syntax (works on PostgreSQL): WHERE stock_lot.lot_no <> stocks.lot_no Not SQL92 Standard, but also works on PostgreSQL: WHERE stock_lot.lot_no != stocks.lot_no You should also pick up an introduction to PostgreSQL and to SQL in general. See http://techdocs.postgresql.org/bookreviews.php for several book suggestions. In English, "Database Queries for Mere Mortals" is a good one for novices. If you need a book in another language, e-mail me back and I'll try to locate a book that has been translated into your preferred tongue. -Josh Berkus ______AGLIO DATABASE SOLUTIONS___________________________ Josh Berkus Complete information technology josh@agliodbs.com and data management solutions (415) 565-7293 for law firms, small businesses fax 621-2533 and non-profit organizations. San Francisco