I've got a mysql table and I need to perform
a complex query on it, but I'm not sure how
to formulate it.

This is what I need to do:

select id,tcc_cn,entered,updated,enteredby,num_bump,
status FROM book_hold WHERE

1) There are no books with the tcc_cn that already
have a status of 'NOTIFIED'.
2) Its updated date is the MIN(updated) for that
tcc_cn.

So, for example, if I have the following items:

tcc_cn   updated   status
-------------------------
990227   03-08-02  WAITING
990227   03-10-02  WAITING
990228   03-08-02  WAITING
990228   03-15-02  NOTIFIED

I would get information back for
this item:

990227   03-08-02  WAITING

Is there a good way to do this in one or
two queries?

Any tips would be most appreciated. Thanks
in advance!

Jeff Shipman           E-Mail: [EMAIL PROTECTED]
Systems Programmer     Phone: (505) 835-5748
NMIMT Computer Center  http://www.nmt.edu/~jeff



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to