How to write a Conditional Selection SQL QUERY in Magento2?

$  collection->getSelect()->where($  getMainTableAlias.'.entity_id IN (SELECT catText.entity_id FROM '.$  catalogCategoryEntityTextTable.' as catText where catText.attribute_id="'.$  attributeId.'" AND  FIND_IN_SET("'.$  groupId.'", catText.value) GROUP BY   catText.entity_id)'); 

I have this query. I have to remove the first where clause so as to avoid any filters but the rest will remain same. How can I perform this task?

Magento2 How to query value in catalog_eav_attribute?

I’ve added a new value in catalog_eav_attribute, similar to Use for Promo Rule Conditions or Used in Product Listing. How do I call that property of the attribute in a phtml view template?

For example it’s called my_custom_field and I want to test for it to be true or false, like:

    <div class="additional-attributes-wrapper table-wrapper">         <table class="data table additional-attributes" id="product-attribute--specs-table">             <caption class="table-caption"><?= /* @escapeNotVerified */ __('More Information') ?></caption>             <tbody>             <?php foreach ($  _additional as $  _data): ?>                 <?php if($  _data['my_custom_field']): ?>  //this code is where I need to check if the attribute's property is true or false                     <tr>                         <th class="col label" scope="row"><?= $  block->escapeHtml(__($  _data['label'])) ?></th>                         <td class="col data" data-th="<?= $  block->escapeHtml(__($  _data['label'])) ?>">                           <?php echo  /* @escapeNotVerified */ $  _helper->productAttribute($  _product, $  _data['value'], $  _data['code']);?>                         </td>                     </tr>                 <?php endif;?>             <?php endforeach; ?>             </tbody>         </table>     </div> <?php endif;?> 

I get an error of “Error filtering template: Notice: Undefined index: my_custom_field” when the template is called.

This is how I created the attribute property: Magento 2 Load database value to custom field in product attribute

Magento2 display sender name, recipient name,recipient email in admin gift card grid

I need to display sender name, recipient name, recipient email in admin gift card grid. This is default module of enterprise.

This sender name, recipient name, recipient email values are coming from product_options.

After adding sender name, recipient name, recipient email columns search filter should work in admin