Skip to content

Magento 2 – Get product attributes selected value via MySQL

I am trying to get a products selected attribute value via MySQL.

Basically, what I need is the SQL equivalent of this:

$_product->getResource()->getAttribute('my_attribute')->getFrontend()->getValue($_product)

Does any one know how I can return the same result but by using a MySQL query?

(I have tried adding ->getSelect() to the end but it doesn’t work.)

Thanks