HI,
this is my table in this i want the last insert sweetname and its total_qty to be displayed .i hve written a query but i can oly get the particular sweet. the qury which i hve used is given below.
Select sweetname , total_qty from SweetStockBalance where sweetname = "Halwa" and date = (SELECT MAX(date) FROM SweetStockBalance where sweetname = "Halwa"

Anubhav ChaudharyRank #29 · 42K reputationPosted Dec 10, 2014, 7:04 PM EST
I think you are not inserting the time with the date in Date column, you should insert datetime in date column and then apply max on this column, then you will get the latest value.
Jitendra KumarRank #760 · 3K reputationPosted Dec 10, 2014, 7:04 PM EST
use this.
Select sweetname , total_qty from SweetStockBalance where sweetname = "Halwa" and
date = MAX(date)