Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8985245
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T21:17:21+00:00 2026-06-15T21:17:21+00:00

I am looking to write an SQL query directly on the Magento database that

  • 0

I am looking to write an SQL query directly on the Magento database that gets all Simple products that have the visibility attribute of “not visible individually”, for which the value is 1 i believe.

Can anyone help with this? So far I have discovered that the visibility value is set in the table

catalog_product_entity_int

but have been unable to progress further. Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T21:17:21+00:00Added an answer on June 15, 2026 at 9:17 pm

    There are many reasons to not do this without the ORM, all of which may (or may not) apply to your needs (store filters, reading data from the correct table, etc). At the very least, you can use the product collection object to build the query which you would run:

    $coll = Mage::getModel('catalog/product')->getCollection();
    $coll->addAttributeToFilter('visibility' , Mage_Catalog_Model_Product_Visibility::VISIBILITY_NOT_VISIBLE);
    echo $coll->getSelect();
    

    The resulting query will look like this:

    SELECT `e`.*, IF(at_visibility.value_id > 0, at_visibility.value, at_visibility_default.value) AS `visibility`
    FROM `catalog_product_entity` AS `e`
    INNER JOIN `catalog_product_entity_int` AS `at_visibility_default`
        ON (`at_visibility_default`.`entity_id` = `e`.`entity_id`)
        AND (`at_visibility_default`.`attribute_id` = '526')
        AND `at_visibility_default`.`store_id` = 0
    LEFT JOIN `catalog_product_entity_int` AS `at_visibility` ON (`at_visibility`.`entity_id` = `e`.`entity_id`)
        AND (`at_visibility`.`attribute_id` = '526')
        AND (`at_visibility`.`store_id` = 1)
    WHERE (IF(at_visibility.value_id > 0, at_visibility.value, at_visibility_default.value) = '1')
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this idea that using SQL VIEWS to abstract simple database computations (such
I have a very simple SQL query that I made which retrieves some user
I'm looking to write a simple proxy server in .NET. Does anyone have any
I am trying to write a SQL Server query but have had no luck
I'm looking to write a stored procedure that takes as a parameter a string
I am looking to write something that seems like it should be easy enough,
Is it possible to write a query that will give me the names of
We have a database that contains information about time booked to projects. We have
I've got a question for my SQL query I've got too write. It's a
I'm looking for a way to build case statements in a sql select query

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.