Home > database >  Calculate the formulae can achieve such a request?
Calculate the formulae can achieve such a request?

Time:10-22



, as shown in this warehouse management system has been set up product A, product B and A1, including product A1 location is A tank, while the product A and product B is not set location, how in the column by A calculation formula or other way, to have the same "assembly code" and did not set the location of different products can also show the same location?
thank you

CodePudding user response:

It is not quite understand


Then A drop-down list directly, code 1001 is A tank

CodePudding user response:

The
refer to the original poster lapchiu response:


, as shown in this warehouse management system has been set up product A, product B and A1, including product A1 location is A tank, while the product A and product B is not set location, how in the column by A calculation formula or other way, to have the same "assembly code" and did not set the location of different products can also show the same location?
Thank you


You can use an update statement, put that data in the database update, such as table, product inventory, you can write

Update the inventory set location=(select Max (b. location) from inventory where b. B assembly code=assembly code)
Where location is null;

Backup data first, and then execute SQL, so as to avoid SQL not to cause problems

CodePudding user response:

Reply thank moderator, your approach is I after each into a batch of products in to perform the update statement, now I don't want to is the purpose of displaying, by changing the database content directly in the dw have a way

CodePudding user response:

reference lapchiu reply: 3/f
thank moderator reply, your approach is after I into a batch of products in every time to perform the update statement, now I don't want to is the purpose of displaying, by changing the database content directly in dw is there any way to


The need to use SQL to achieve, so write when writing SQL data window, whether it is empty, empty in the same assembly code location

Data window expression can also write, but hold you to the assembly code sorting, grouping, take a Max (location for group 1)

CodePudding user response:

SQL code @ moderator
  • Related