I have a simple question, and I am sorry in advance if this is too basic. I am connecting to a remote database using
import pyodbc
import pandas as pd
import numpy as np
cnxn = pyodbc.connect('DSN=MYDSN')
and I am able to pull some data using
sql = "SELECT * FROM MASTER.PRICES"
dataframe = pd.read_sql(sql, cnxn)
However, using the query
sql = "SELECT * FROM MASTER.PRICES LIMIT 10"
sql = "SELECT * FROM MASTER.PRICES where ROWNUM <= 10"
give an error such as
Unable to parse query text: Incorrect syntax near "SELECT", found "10".
for the first query.
My questions are:
- without further information about the database, how can I know what is the right syntax for a LIMIT statement?
- How can I even know what kind of database I am accessing?
Thanks!