How to Count Records in SQL Starting from a Specific Value

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 :slight_smile: