2 Replies - 19291 Views - Last Post: 27 June 2006 - 03:42 AM Rate Topic: -----

#1 JavaWannaBe  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 22
  • Joined: 23-March 06

sql query using NOT EXISTS

Posted 18 June 2006 - 05:41 AM

I am trying to list the three most expensive products in the Products table. (Must use NOT EXIST STATEMENT)

Here is my Products table

PID PNAME CITY QUANTITY PRICE
--- ------------- -------------------- ---------- ----------
p01 comb Dallas 111400 .5
p02 brush Newark 203000 .5
p03 razor Duluth 150600 1
p04 pen Duluth 125300 1
p05 pencil Dallas 221400 1
p06 folder Dallas 123100 2
p07 case Newark 100500 1

7 rows selected.

Any useful links to NOT EXISTS STATEMENTS would also be helpful.

Thank You

Is This A Good Question/Topic? 0
  • +

Replies To: sql query using NOT EXISTS

#2 Amadeus  Icon User is offline

  • g+ + -o drink whiskey.cpp
  • member icon

Reputation: 248
  • View blog
  • Posts: 13,507
  • Joined: 12-July 02

Re: sql query using NOT EXISTS

Posted 18 June 2006 - 07:21 AM

There is no actual NOT EXISTS statement, only the negation of the EXISTS statement with the NOT operator...here is a good look at the usage of both:
http://www.techonthe.../sql/exists.php
Was This Post Helpful? 0
  • +
  • -

#3 born2c0de  Icon User is offline

  • printf("I'm a %XR",195936478);
  • member icon

Reputation: 180
  • View blog
  • Posts: 4,667
  • Joined: 26-November 04

Re: sql query using NOT EXISTS

Posted 27 June 2006 - 03:42 AM

or you can use PL/SQL to display the expensive products one by one in a loop.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1