Cross reference query help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The following is a query I am working on today.  I need help tweaking on it.

What I am trying to get for results from the query are where there are
rows in either table, not all 3 tables linked together.

In other words I am trying to INNER JOIN these two pairs of tables for
possible results:

`store_product_profile` and `paypal_cart_info`

OR

`store_product_profile` and `mail_order_cart`

SELECT `store_product_profile`.`product_name`
FROM (
`store_product_profile`
INNER JOIN `paypal_cart_info` ON `store_product_profile`.`reference` =
`paypal_cart_info`.`itemnumber`
)
INNER JOIN `mail_order_cart` ON `store_product_profile`.`reference` =
`mail_order_cart`.`store_product_profile_reference`
WHERE `store_product_profile`.`discontinued` =0
AND `store_product_profile`.`reference` =7

Finally I need help with the GROUP BY syntax also.  I only want the name
of the product once, not if it was in several previous purchases.

Any help is appreciated.

Ron


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux