I'm thinking (because I haven't run the query) that you are actually looking to select pa.products_id instead of p.products_id... Right now you are receiving all products_id in the products table that are equal to or linked to categories_id 510... Oh and for the sake of "study" making it possible to retrieve information about attributes, but without any specific request of attribute related data...
Code:
SELECT
pa.`products_id`, p.`products_status`, p2c.*
FROM
`products` AS p
INNER JOIN
`products_to_categories` AS p2c
ON (p.`products_id` = p2c.`products_id`
AND p.`products_status` = 1
AND p2c.`categories_id` = 510)
Left JOIN
`products_attributes` AS pa
ON (pa.`products_id` = p.`products_id`
AND pa.`options_values_id` != 91)
In the future, it may be of more assistance to identify what is meant by "does not successfully apply"...
As for an external importer/exporter type program, yeah, that *should* be easy to address...
export all product within a category (including the products_id as part of the export) to be able to identify the products_id of all involved.
Export the basic attributes,
match the products_ids across the two downloads removing the products_ids in the attributes group that don't apply.
Identify the products that don't have the desired attribute.
Create a file to add/import that information.
Submit/process.
Bookmarks