Several database Sql statements
(1) there may be tare weight records of multiple cars in the same table. I want to update the earliest record, that is, to update their tare weight. In sqlite3, it is as follows:
Update CarNoTable set TareWeight = '9080'-where CarNO=' Beijing A6390' and TareWeight =-(select TareWeight from CarNoTable where CarNo=' Beijing A6390'-order by TareTime limit 0men5)
CarNoTable: tabl
TareWeight: tare field
CarNo: car number
TareTime: tare weight time
(2) convert the string field to an integer to find the largest record. Like multiple tare records of a vehicle, you want to find out the largest record.
Select max (cast (TareWeight as FLOAT)) from CarNoTable where CarNo = 'Beijing A6390'
(3) check the maximum tare weight and time
Select CarNo, TareWeight,TareTime from CarNoTable where cast (TareWeight as FLOAT) in (select max (cast (TareWeight as FLOAT)) from CarNoTable where CarNo=' Beijing A00A01')