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
title XML/HTML CodeCopy content to clipboard <...
Effect html <div class="sp-container"...
Common application scenarios The interfaces of cu...
Preface The docker image cannot be deleted. Check...
Install SSHPASS For most recent operating systems...
In the MySQL database, when we need fuzzy query, ...
Table of contents 1. Download the MySQL installat...
Let's take a look at the command to restart t...
Table of contents 1. Observable 2. Higher-order f...
Nginx is used as the server, Mongo is used as the...
When I was writing a project yesterday, I needed ...
Table of contents Introduction Download and insta...
1. From father to son Define the props field in t...
1. Use the SELECT clause to query multiple tables...
Say goodbye to the past Before vscode had remote ...