Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

SQL / Multiple Tables


  • Please log in to reply

#1
Goofy_1969

Goofy_1969

    New Member

  • Member
  • Pip
  • 1 posts
What I am trying to do is tie two tables together but not necessarily with a JOIN. I have a SALES file and a PRICE file. I need to do this with my data:

IF SALES.CSTNO = PRICE.KEY1 THEN IF SALES.ITMID = PRICE.KEY 2 THEN PRICE.PRICE

ELSE IF SALES.ITMID = PRICE.KEY1 THEN IF SALES.CSTNO = PRICE.KEY2 THEN PRICE.PRICE

ELSE IF SALES.CSTTYP = PRICE.KEY THEN IF SALES.ITMID = PRICE.KEY2 THEN PRICE ELSE 0

So when I try to manage the joins it takes forever to run because PRICE.KEY1 and PRICE.KEY2 can be joined to three different fields in the SALES file.

What is the way to accomplish this?
  • 0

Advertisements







Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP