Tag Archives: NULL

Magento 2 Allow NULL Value Multiselect System Configuration

It can be achieved bu adding the <can_be_empty>1</can_be_empty> tag in system.xml file

Ex:

<field id="hideprice" translate="label" type="multiselect" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Hide Price For</label>
<source_model>PHPCodez\Permission\Model\Config\Source\Group\Multiselect</source_model>
<can_be_empty>1</can_be_empty>
</field>
Share

SQL NULL Functions

Below given are the SQL NULL functions

ISNULL()
NVL()
IFNULL()
COALESCE()

We can use these function to manage the null values .

mysql> SELECT 1+IFNULL(age,0) as age  FROM users ;
+—–+
| age |
+—–+
|   1 |
|   1 |
|   1 |
|   1 |
|   1 |
+—–+
5 rows in set (0.00 sec)

Share