Help
Posted in 1999
Can someone please help. I have 2 tables, an order and an address. The key to the order table is acct_no, order_no. The key to the address table is acct_no, addr_type. Joining these two based on account number would create a cartisan join. What I am trying to do is create a stored proc that would assign a sequence number within account number on each table. I have gotten this far, what I would like to do next is join both tables based on acct_no and the seq_nbr. Here is the syntax: SELECT a.account_number, a.order_number, a.order_date, a.keycode, a.num_items, a.order_amt, b.household_id, b.title_code, b.full_name, b.address1, b.address2, b.city, b.state, b.zipcode, b.zip_plus4, b.phone_number, b.mail_flag FROM Marketing:informix.orders a, Marketing:informix.address b where a.account_number = b.account_number and sp_orderseqnbr(a.account_number) = sp_addrseqnbr(b.account_number) This returns every row from the orders tables, not just the ones that match sequence number. Would anyone have any clues why? Thanks, Jeff