Hi, as I am using PERL to operate my MySQL-Database, I need the following statement to carry out the new entries: (Id is an auto-incrementing column) $sth2 = $dbh2->prepare("SELECT * FROM mywartungstermine WHERE (Id > (Id - $id_max))"); Refering to the manuals, it is allowed to use subtraction with "-" in this statement, but I receive syntax error. I already used the variable $id_max with ' ', (-> PHP) but then it wasn't resolved correctly and all entries where shown. Any ideas how to solve this problem with only one SELECT ? Thanks for hleping especially as I am still a Newbie in SQL. Yours, Thomas