Results 1 to 6 of 6

Thread: Mysql

  1. #1
    Join Date
    Sep 2014
    Posts
    2

    Unanswered: Mysql

    1. I have a table1 containing all items with quantity in my store.
    Eg. Pencil - 100
    pen-100
    eraser-0
    sharpener-15

    2. Now i have another table2 having user requirements.

    Eg. Pencil - 50
    pen -20
    eraser-10
    sharpener-10

    3. Now my requirement is while a administrator approves for user requirement the same should deducted from table -b and if store value is 0 it should send some error.

    4. Then while administrator approves he should have following coloums

    1. Sl no. Item demanded-quantity quantity-held
    01 pen 50 100
    02 pencil 20 100
    03 sharpener 10 15
    04 eraser 10 0


    the quantity held column should fetch from table-1 and rest from table-2
    Last edited by sjarun833; 09-01-14 at 06:43. Reason: TO MAKE MY QUESTION MORE CLEAR

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    What have you tried so far?
    George
    Home | Blog

  3. #3
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    Quote Originally Posted by sjarun833 View Post
    1. I have a table1 containing all items with quantity in my store.


    3. Now my requirement is while a administrator approves for user requirement the same should deducted from table -b and if store value is 0 it should send some error.
    why store this?
    its derived data
    it can be generated at anytime using a query
    granted in some stock control systems you run a periodic stock check, and you then run your stock query from that stock check point and roll up any stock movements from there forward
    I'd rather be riding on the Tiger 800 or the Norton

  4. #4
    Join Date
    Sep 2014
    Posts
    2

    Question

    Quote Originally Posted by gvee View Post
    What have you tried so far?
    SIR,
    THANKS FOR YOUR REPLY. I HAD DONE THE DEDUCTION FROM STOCK TABLE PART. BUT IT IS GETTING DEDUCTED EVEN IF THE STOCK HOLD IS ZERO RESULTING IN NEGATIVE VALUE (eg. -10).

  5. #5
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    and your query is?
    what steps have you taken to resolve the problem
    I'd rather be riding on the Tiger 800 or the Norton

  6. #6
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Quote Originally Posted by sjarun833 View Post
    SIR,
    THANKS FOR YOUR REPLY. I HAD DONE THE DEDUCTION FROM STOCK TABLE PART. BUT IT IS GETTING DEDUCTED EVEN IF THE STOCK HOLD IS ZERO RESULTING IN NEGATIVE VALUE (eg. -10).
    Can you share your code that does this?
    George
    Home | Blog

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •