Question about SQL

Hi, imagine whenever a new player joins my server, i create a new value on a column called ply_id using sql.Query() . How can I create a variable that gets the last value of the column?
If ply_id column was 1 , 2 , 3 , 4 , 5 … 238 How can I get the last value added? (238 in this case)

sql.Query(“SELECT last_insert_rowid() as id”)[1].id

I just found SELECT MAX(column_name) FROM table_name; but thanks anyways :slight_smile: