need When querying a field, you need to give the same value to a field. You can hard-code this value or get it from the database 1. Hard-coded values SELECT mfr_id AS mfrId, mfr_name AS mfrName, IFNULL(NULL, 587694978080178176) AS suppId FROM mater_prod materProd Query results 2. Get values from the database SELECT mfr_id AS mfrId, mfr_name AS mfrName, IFNULL(NULL, mfr_id) AS suppId FROM mater_prod materProd Query results Supplementary knowledge: How to set a default value if the mysql query field is empty In common cases, the following is to calculate inventory. If the inventory or locked inventory is empty, the default value is 0. SELECT (IFNULL(t_inventory.pro_number,0)-IFNULL(t_inventory.locked_number,0)) AS content_number FROM t_inventory The above operation of assigning default values to fields during MySQL query is all the content that the editor shares with you. I hope it can give you a reference. I also hope that you will support 123WORDPRESS.COM. You may also be interested in:
|
<<: Vue realizes the product magnifying glass effect
>>: How to install rabbitmq-server using yum on centos
1- Styling dropdown select boxes - Modify the dro...
1. Why set maxPostSize? The tomcat container has ...
Problem: When using JDBC to connect to the MySQL ...
Preface: I have often heard about database paradi...
Previously, we all used files with the suffix .ms...
What is content overflow? In fact, when there is ...
Preface Linux has corresponding open source tools...
In many cases, large and medium-sized websites wi...
The title images on Zhihu Discovery columns are g...
Table of contents Two modules for using nginx for...
External Access Randomly map ports Using the -P f...
As shown below: SELECT count(DISTINCT(a.rect_id))...
Preface Today, Prince will talk to you about the ...
I recently joined a new company and found some mi...
As shown below: #!/usr/bin/env python3.5 import p...