|
| Novice SQL question |
 |
2 Apr 2008 07:51:59 -0700 |
Here's the query I have created so far:
select *
from eps_order_items OI
join eps_order_dates OD on OD.ORDER_ITEM_ID = OI.ORDER_ITEM_ID
join eps_requisition_order RO on RO.ORDER_SCHEDULE_ID =
OD.ORDER_SCHEDULE_ID
join eps_requisition_details RD on RD.REQUISITION_ITEM_ID =
RO.REQUISITION_ITEM_ID
join ( select sir_no || req_no as REQ_ID, WORK_ORDER_NO
from ewm_wo_parts
where sir_no is not null or req_no is not null
) WP on WP.REQ_ID = RD.EXT_REQ_ID
The last JOIN is to a sub-query so I can combine the values of
two fields into one. The desired data is either in one field
or the other, but never in both, and they are equivalent data
types.
Is that the way to go, or is there a better way?
It seems to be producing a Cartesian product or something...
|
| Post Reply
|
| Re: Novice SQL question |
 |
3 Apr 2008 07:32:50 -0700 |
That SQL won't be accepted by InterBase. If you aren't using
InterBase, you'll get better answers on a group for a server which you
are using.
--
Craig Stuntz [TeamB] · Vertex Systems Corp. · Columbus, OH
Delphi/InterBase Weblog : http://blogs.teamb.com/craigstuntz
Please read and follow Borland's rules for the user of their
|
| Post Reply
|
|
|
|
|
|
|
|
|
|