+ 2

MariaDB replace 0

Are there opportunities for rules to replace 0 value by values of another dataset? That before eg?

3rd Nov 2022, 7:13 AM
Oma Falk
Oma Falk - avatar
2 Réponses
+ 3
The question is not quite clear. MariaDB syntax is very similar to Mysql. Do you want to show a different value when querying tables (SELECT)? If so, you can JOIN another table and use a CASE operator in your query. If you want to replace NULL values, you can also take advantage of IFNULL and COALESCE functions. https://mariadb.com/kb/en/case-operator/ https://mariadb.com/kb/en/ifnull/ https://mariadb.com/kb/en/coalesce/ Or you want to change the value when it is inserted into a table? Then a TRIGGER can help you. https://mariadb.com/kb/en/trigger-overview/
3rd Nov 2022, 8:59 AM
Tibor Santa
Tibor Santa - avatar
+ 3
Thanks Tibor Santa ! A set of opportunities is always 👌
3rd Nov 2022, 1:44 PM
Oma Falk
Oma Falk - avatar