I have problem with MSSQL in R language, similar like in R DBI ODBC error: nanodbc/nanodbc.cpp:3110: 07009: [Microsoft][ODBC Driver 13 for SQL Server]Invalid Descriptor Index , but a little another, or I don't understand something.
I have clearly connection with DB and my SELECT works when I send something like this:
third <- DBI::dbGetQuery(con, "SELECT TOP 1
arr_delay_new,
fl_date,
carrier,
origin_city_name,
dest_city_name
FROM Flight_delays
ORDER BY arr_delay_new DESC")
Problem is in the columns order. I have to show response in other order - like this:
third <- DBI::dbGetQuery(con, "SELECT TOP 1
carrier,
arr_delay_new,
fl_date,
origin_city_name,
dest_city_name
FROM Flight_delays
ORDER BY arr_delay_new DESC")
and when I send this request - is error: "result_fetch(res@ptr, n)': nanodbc/nanodbc.cpp:2966: 07009: [Microsoft][ODBC Driver 13 for SQL Server]Invalid Descriptor Index"
How I can set up this or which workaround could help me change order?
I'm fresh in R-language, so sorry if it's to easy