Nightfire
06-17-2011, 02:29 PM
First time I've ever done anything like querying 2 tables at a time, and I'm struggling. I have the following query
SELECT
categories.id,
categories.listing,
categories.catname,
subcategories.catid,
subcategories.subcat,
subcategories.listings,
subcategories.url
FROM
categories
LEFT JOIN
subcategories
ON
categories.id=subcategories.catid
ORDER BY
categories.catname,subcategories.subcat
ASC
I am wanting to only show 3 results at a time from subcategories table. I tried adding LIMIT to the end of the query, but that just limited both tables.
SELECT
categories.id,
categories.listing,
categories.catname,
subcategories.catid,
subcategories.subcat,
subcategories.listings,
subcategories.url
FROM
categories
LEFT JOIN
subcategories
ON
categories.id=subcategories.catid
ORDER BY
categories.catname,subcategories.subcat
ASC
I am wanting to only show 3 results at a time from subcategories table. I tried adding LIMIT to the end of the query, but that just limited both tables.