Ok, I did not make the correlation between what rows you wanted and what the
data was.  You are not getting this in one query.  It would require a
sub-select.  However, simple, but possibly slow queries will get it.

select * from transaction_log where event_log_id=3

get those back and

select order_id from transaction_log where order_id not in ({id list})

The list could be pretty big I guess.

Brian.

----- Original Message -----
From: "Paul Maine" <[EMAIL PROTECTED]>
To: "Brian Moon" <[EMAIL PROTECTED]>; "MySQL MySQL" <[EMAIL PROTECTED]>
Sent: Sunday, August 25, 2002 7:02 AM
Subject: RE: SQL JOIN Challenge - Help Please


| This is deceptively simple, and I very much appreciate your suggestion -
but
| it doesn't work.  Your suggestion still returns records that I should not
| see. Once again, there is a one to many relationship between an order_id
in
| the order_id in the transaction response table. Please see my original
| email.
|
| Thank you
| Paul
| sql query
| -----Original Message-----
| From: Brian Moon [mailto:[EMAIL PROTECTED]]
| Sent: Sunday, August 25, 2002 12:11 AM
| To: Paul Maine; MySQL MySQL
| Subject: Re: SQL JOIN Challenge - Help Please
|
|
| If I read right, this is a pretty basic join so I am assuming that you
have
| never done a join in your life.
|
| select
|     distinct order.order_id
| from
|     order
| inner join
|     transaction_log on
|         order.order_id=transaction_log.order_id and
|         transaction_log.event_log_id <> 3
|
| Brian.
|
|
| ----- Original Message -----
| From: "Paul Maine" <[EMAIL PROTECTED]>
| To: "MySQL MySQL" <[EMAIL PROTECTED]>
| Sent: Saturday, August 24, 2002 7:31 PM
| Subject: SQL JOIN Challenge - Help Please
|
|
| | I have an order table and a transaction log table. The order table has
an
| | order_id and a number of other columns that are not germain to my
| question.
| | The transaction log has an order_ID and an event_log_id column. The
order
| id
| | from the order table will have a one to many relationship to the
order_id
| | data in the transaction log table. The event_log_id is an integer that
| | assumes a value of 1 if the credit card is authorized, a value of 2 if
the
| | credit card is denied or some other type of error, and a value of 3 if
the
| | credit card is delay captured.
| |
| | I need to create a query that would return all of the order.order_ids
that
| | are authorized but have not been delayed captured. How can I accomplish
| this
| | task?
| |
| | Thank You
| | Paul
| | sql query
| |
| |
| | ---------------------------------------------------------------------
| | 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
| |
| |
|
|
| ---------------------------------------------------------------------
| 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
|
|


---------------------------------------------------------------------
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