[RESOLVED] select statement to get the all data with last sr_number save
I just want to know what is the code to get the last inserted row on database.
I tried max and last_insert_id yet it did not solve my problem
it display all data from my database.
SELECT last_insert_id(sr_number), sr_date, Items, SubItems, ItemCode, DemandedQty FROM stock_requisition;
it only display last row.. but I need to display all data with all data with same sr_number
SELECT max(sr_number), sr_date, Items, SubItems, ItemCode, DemandedQty FROM stock_requisition;
for example :
I attach my sample data from my database:
Thank you so much
SELECT sr_number, sr_date, Items, SubItems, ItemCode, DemandedQty FROM stock_requisition WHERE sr_number = (SELECT max(sr_number) from stock_requisition)
Originally Posted by chrisranjana
It resolved my problem
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)