Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello!
I have a MySQL database, this bench I have the Products table, where I have a field that refers to the product code and another subsidiary of the investment, the 0006 is the stock, how can I do to show only the product code listed in 0006 and not included in other 5 branches?
Thanks
Do you mean you want to list the products if atleast one of the store has no stock for a product and another store having stock more than for the same product? Then try this
T1:
Load * Inline [
Code,Shop,Amount
0525,0001,10
0525,0002,34
0525,0003,15
0464,0001,5
0464,0002,3
0464,0003,8
0876,0001,20
0876,0002,0
0876,0003,0 ];
Inner Join(T1)
Load Code Where Flag = 1;
Load Code,If(Min(Amount) = 0 And Max(Amount)>1,1,0) As Flag Resident T1 Group By Code;
load
product_table as whateva_name ,
field
from ...
try adding
where product_table=6;
Can you provide sample input and expected output?
Hello!
I have a table with the product code, the store that the product and quantity.
Database:
Code Shop Amount
0525 0001 10
0525 0002 34
0525 0003 15
0464 0001 5
0464 0002 3
0464 0003 8
0876 0001 20
0876 0002 0
0876 0003 0
I wish that the output is only listed products that are cleared in a store and others are in balance over 1.
Code Shop Quantity
0876 0001 20
0876 0002 0
0876 0003 0
thank you
Do you mean you want to list the products if atleast one of the store has no stock for a product and another store having stock more than for the same product? Then try this
T1:
Load * Inline [
Code,Shop,Amount
0525,0001,10
0525,0002,34
0525,0003,15
0464,0001,5
0464,0002,3
0464,0003,8
0876,0001,20
0876,0002,0
0876,0003,0 ];
Inner Join(T1)
Load Code Where Flag = 1;
Load Code,If(Min(Amount) = 0 And Max(Amount)>1,1,0) As Flag Resident T1 Group By Code;
Thanks Anbu, solved my problem.