I need an SQL query that counts prime records from 2 up to the highest prime number not exceeding a given value.
hey, try create a func to check primeness and then make a subselect filtering records between 2 and your value. then just count(*) the results. hope it works for u