Sure - no problem. Anything you can code in JDBC/SQL is legal in a BMP bean.
EJB's are not simple mindless castings to
Java of database tables, they're logical entities in their own right.
In fact, the EJB spec itself doesn't demand that persistence even be done to a database - you could use flat files, network devices, etc. DBMS's just happen to be one of the more convenient ways of doing it (and, of course in CMP, the one the container normally supports).