For example, if today's route is stored in DB,
I want to print out a list of today's travel routes. What I want to do here is not print out all the travel routes, but if it's the same place for hours (overlapping data), I want to print out only the first record (and the last record value), so please advise me what to do with the query.
mysql
It's not an example of leaving the first and the last, but for example, leaving only the first, you have to create a temporary table.Source
CREATE TEMPORARY TABLE duplicates (id int primary key)
INSERT INTO duplicates (id)
SELECT t1.id
FROM table t1
join table t2 on t2.id = t1.id + 1
WHERE t1.location = t2.location
This creates a table called duplicates, and then erases the contents in the duplicates from the original table.
What you're trying to do now is you're trying to determine the same position, and you're going to need to calculate the distance because it's not going to be the same position. Then you have to use an expression that calculates the distance with the longitude of the stomach, which requires a separate method implementation. So I recommend you just take care of it on the server.
Or when you first raise the value from the cla to the DB, you can just decide that it's the same location (within 00m distance) and put the value differently if it's the same location.
626 Uncaught (inpromise) Error on Electron: An object could not be cloned
577 Who developed the "avformat-59.dll" that comes with FFmpeg?
618 GDB gets version error when attempting to debug with the Presense SDK (IDE)
925 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
© 2024 OneMinuteCode. All rights reserved.