I have a query where I’m trying to select the most recent row based on date. So what I would like my query to do is to select the most recent datapoints for a couple columns in my database. sql = f&…
Tag: python
SQL apply where clause to an arbitrary query results
I’m working on a system where the user introduces an SQL server/db connection and a valid SQL query, which I save on my system. I’m using python+sqlalchemy+pandas to accomplish this. That query will return a table like this one, in which the only rule is that the query result must have a timestamp as DateTime field and at least another
How to properly store a file location to a postgresql table?
I am very new to postgresql. I don’t plan to study it fully in-depth right now as I have other priority topics to finish. But now I need to know some basics of postgresql for the perfect completion of …
Delete a task stored in SQL database through html form using Python
This is a web app written in Python to add and delete tasks. This is the add_tasks function: @app.route(“/add”, methods=[“GET”, “POST”]) @login_required def add(): …
Storing struct_time in SQL
Some code I am writing in Python takes in a date from a server in the struct_time format (with the 9 args). How can I store this date in an SQL database, and be able to read back this date as a …
“Operating system is not presently configured” error with Access ODBC
I get this error when I try to connect to Microsoft Access Database via Python. The code has been working all the time and only started popping the today. Can someone please guide me to why the problem may be occurring now? I tried doing this “Operating system is not presently configured” error with Access ODBC even after removing the
Best way to create and host a python webapp that takes user input and adds it to sql databases?
I’m currently working on a project to make data entry easier for myself, I have sql tables set up in an azure database, and i can write python code that adds data to them easily enough, but what i …
Is there a way to load multiple values of one column into new lines to a single row in sql
This is how my data looks, emp_id,skills 1234,python|java|sql|R|javascript 5639,C|HTML|php|perl This is how data need to be loaded into the table emp_id skills python 1234 java …
How to create a leaderboard as a database
I need to create a database which is a top 5 leaderboard, however, what I tried didn’t work – it brought up many different errors (code below): Problems: The 4th line beginning “db = ” comes up with an error on the brackets. I initially thought it had to do with the fact that I am trying to make a
Python – Running a SQL in a loop based on column value
I am trying to build a SQL query that runs based on certain conditions (if a column is filled run Query 1 else Query 2 and so on) as shown below: I am trying to build something like the above but the number of fields as variable (fields like col_a and col_b) are 6 in number. Is there a way