A
andary
Hi guys,
Basically I'm wanting a query to produce DISTINCT results for
"gallery.prod_title" only; obviously there are two tables involved.
With the DISTINCT results I'm aiming to print other data like:
contact_details.bus_name
contact_details.subdomain
gallery.prod_linkSm
gallery.prod_title
gallery.prod_desc
Question: WHERE / HOW does this come in to the statement??
The following query is roughly what I'm working with, and I know I've
mixed in too many columns which is 'round about the point where I
through I'd post this question.
--------------------------------------
SELECT DISTINCT gallery.prod_title, contact_details.subdomain,
gallery.prod_linkSm, contact_details.bus_name, gallery.prod_title,
gallery.prod_desc
FROM contact_details, gallery
WHERE gallery.id = contact_details.id
AND contact_details.anzsic = '4241002'
AND contact_details.list_show = 1
AND contact_details.show_gallery > 0
ORDER BY RAND()
LIMIT 5
Basically I'm wanting a query to produce DISTINCT results for
"gallery.prod_title" only; obviously there are two tables involved.
With the DISTINCT results I'm aiming to print other data like:
contact_details.bus_name
contact_details.subdomain
gallery.prod_linkSm
gallery.prod_title
gallery.prod_desc
Question: WHERE / HOW does this come in to the statement??
The following query is roughly what I'm working with, and I know I've
mixed in too many columns which is 'round about the point where I
through I'd post this question.
--------------------------------------
SELECT DISTINCT gallery.prod_title, contact_details.subdomain,
gallery.prod_linkSm, contact_details.bus_name, gallery.prod_title,
gallery.prod_desc
FROM contact_details, gallery
WHERE gallery.id = contact_details.id
AND contact_details.anzsic = '4241002'
AND contact_details.list_show = 1
AND contact_details.show_gallery > 0
ORDER BY RAND()
LIMIT 5