The function processes the sql request. It receives parameters and one of them can be either “null” or a value (uuid), I need to add this value to where. But there is a problem, because with null “where param is null”, but with the value “where param = value” Example Answer In sql, null = null and null <> null
Tag: python
SQL to Dataframe not accounting for empty cells
I pull from a SQL database which sometimes looks like this. A B C D _ E F _ G So when I put it into a data frame and print it as a CSV I want it to look like A, B, C, D, , E, F, , G But instead it looks like A, B, C, D, E,
Overwriting of variable columns in sqlite without string-based construction?
I have a JSON object containing sets of a “keyX” and the corresponding “value”. I need to write the values into a database into the column “keyX”. Unfortunately one can’t format the SQL Query like this: Therefore I’m currently solving it like this: This is working perfectly, but SQL queries shouldn’t be constructed string-based. In this specific case, the keys
Python MariaDB pip install failed, missing mariadb_config
I am using Linux Ubuntu 18.04 and python 3. I am trying to build a connection between a maria-db and my python scripts. Therefore I have to install the mariadb package. I have already installed: sudo …
Azure SQL Database Manipulation
Is it possible to create a table in an Azure sql database using Python? I am pulling a list of things from an API and then want to push them to a table in my Azure sql db but can not find a tutorial or guide on how to do so. Googling for it led me to tutorials on how
Convert SAS proc sql to Python(pandas)
I rewrite some code from SAS to Python using Pandas library. I’ve got such code, and I have no idea what should I do with it? Can you help me, beacase its too complicated for me to do it correct. I’ve changed the name of columns (for encrypt sensitive data) This is SAS code: This is my try in Pandas:
Select row where column is different from previous row
I am trying to write a query to track the changes of a boolean column in a table. The table looks like this So what i would want is row 3 where the is_active changed to false. Then after that i would want the next row where it changed to true again. This is what i tried: So the subquery
INSERT INTO a whole list with python and SQL
I’m inserting data in a database with INSERT INTO The main problem is that I’m inserting around 170k points of data and I’m looping a code like that: for row in data: SQL=”’INSERT INTO Table …
How can I create a column with time HH:MM from a timestamp column with time HH:MM:SS in my dataset [closed]
How can I create a column with time HH:MM from a timestamp column with time HH:MM:SS in my dataset
Finding unique number of IDs in multiple groups
I have a dataset that has doctors and the various practices they work in. Each doctor in my dataset works in at least 1 practice but as many as 17 different practices. I would like to know the unique …