Issue 1:
Describe the bug

a CTE cannot be aliased multiple times, raise Multiple CTEs with SAME NAME;

To Reproduce

from sqlalchemy import Table
from sqlalchemy import MetaData
from sqlalchemy import Column
from sqlalchemy import Float
from sqlalchemy import create_engine

sa_table = Table('district',
MetaData(schema='real_estate'),
Column('price', Float))

# table = select([sa_table.c.price]).cte('not_a', nesting=True)
table = select([sa_table.c.price]).cte('not_a')
sum_table = table.alias('a')
common_table = table.alias('a')
sql = select(
[select([func.sum(sum_table.c.price)]).as_scalar() /
common_table.c.price]
).select_from(common_table)

sql.compile()

Error

Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/Users/zzz/backend/mdt_parser/py_venv/lib/python3.8/site-packages/sqlalchemy/sql/elements.py", line 489, in compile
return self._compiler(dialect, **kw)
File "/Users/zzz/backend/mdt_parser/py_venv/lib/python3.8/site-packages/sqlalchemy/sql/elements.py", line 553, in _compiler
return dialect.statement_compiler(dialect, self, **kw)
File "/Users/zzz/backend/mdt_parser/py_venv/lib/python3.8/site-packages/sqlalchemy/sql/compiler.py", line 765, in __init__
Compiled.__init__(self, dialect, statement, **kwargs)
File "/Users/zzz/backend/mdt_parser/py_venv/lib/python3.8/site-packages/sqlalchemy/sql/compiler.py", line 454, in __init__
self.string = self.process(self.statement, **compile_kwargs)
File "/Users/zzz/backend/mdt_parser/py_venv/lib/python3.8/site-packages/sqlalchemy/sql/compiler.py", line 489, in process
return obj._compiler_dispatch(self, **kwargs)
File "/Users/zzz/backend/mdt_parser/py_venv/lib/python3.8/site-packages/sqlalchemy/sql/visitors.py", line 82, in _compiler_dispatch
return meth(self, **kw)
File "/Users/zzz/backend/mdt_parser/py_venv/lib/python3.8/site-packages/sqlalchemy/sql/compiler.py", line 3263, in visit_select
text = self._compose_select_body(
File "/Users/zzz/backend/mdt_parser/py_venv/lib/python3.8/site-packages/sqlalchemy/sql/compiler.py", line 3407, in _compose_select_body
[
File "/Users/zzz/backend/mdt_parser/py_venv/lib/python3.8/site-packages/sqlalchemy/sql/compiler.py", line 3408, in <listcomp>
f._compiler_dispatch(
File "/Users/zzz/backend/mdt_parser/py_venv/lib/python3.8/site-packages/sqlalchemy/sql/visitors.py", line 82, in _compiler_dispatch
return meth(self, **kw)
File "/Users/zzz/backend/mdt_parser/py_venv/lib/python3.8/site-packages/sqlalchemy/sql/compiler.py", line 2549, in visit_cte
raise exc.CompileError(
sqlalchemy.exc.CompileError: Multiple, unrelated CTEs found with the same name: 'a'```

### Versions

- OS: macOS Big Sur
- Python: 3.8
- SQLAlchemy: 1.3.24 & 1.4.24
- Database: Postgresql
- DBAPI (eg: psycopg, cx_oracle, mysqlclient): psycopg

### Additional context

_No response_

Issue 2:
Migrated issue, originally created by Dobes Vandermeer (@dobesv)

I am trying to use the "baked query" pattern to reduce the time spent generating SQL, which currently is quite significant for our app.

One thing I can't seem to parameterize using a bindparam, however, is the limit on the query.

Although in #805 the limit was changed into a bindparam, this doesn't allow me to provide my own bindparam but rather always creates its own bindparam, assuming the limit I procide is a number already.

I think that if the places where currently it wraps a numeric limit into a bindparam using sql.literal() it would also check if limit was already a bindparam then it would be good.

Here's an example that can be pasted into the test suite:

def test_select_with_bindparam_limit(self):
"""Does a query allow bindparam for the limit?"""
sess = create_session()
users = []

q1 = sess.query(self.classes.User).order_by(self.classes.User.id).limit(sa.bindparam('n'))
for n in xrange(1,4):
users[:] = q1.params(n=n).all()
assert len(users) == n