|
2 tables, 1 is the parts list bj (one field represents the part code and one field is the flag tag), and 1 is the price list jg (there is also a part code field and a price field)
Now find the price of all parts whose flag is true.
select bj.id, jg.jg from bj, jg where bj.flag = 1
The problem is that in the price list, the prices of some parts do not exist. According to the above query, only the parts that exist in both tables are available, but I cannot get a list of all parts with flag = 1.
The requirement is to get a list of all parts with flag = 1. If any part does not exist in the price list, it will automatically take 0. |
|