Skip to content

Compare two data frames and find number of nulls

I have a problem. I heve data frame 1 named “df”: enter image description here And I have the data frame 2 named “dfP1”: enter image description here I want to compare the unique rows that exist in colum “Campo a Validar” from “dfP1” vs the columns in “df&…

Get executed sql statement in pymysql

I am executing a query that is invalid, but I’d like to be able to see exactly what the query is being executed by pymysql to debug it. Is there a way to do something like: Answer As per the documentation, you should be able to do: This read-only property returns the last executed statement as a string.…

String formatting — skip one format string

I have the following sql statement: Basically I want to string-format everything except for the second-to-last format string so it looks like: What would be the best way to do this? Answer Double %% the single % to escape it: Where is the StringBorg that we direly need? That would make this safe.

Conditionally joining from multiple tables

Does SQL allow some form of conditional “table choosing” within the Join statement? ie. selecting a different table to join based on a predefined variable/condition. The error I get when attempting this method is ORA-00905: missing keyword. Answer No. Neither SQL nor Oracle allow this, unless you …

How to rename database file programmatically?

I have two databases: database_A. Name of file is database_A.mdf. database_B. Name of file is database_B.mdf. Then I what I do: Drop database_A. Rename database_B to database_A: sp_renamedb ‘database_B’,’database_A. However, name of file is still database_B.mdf. Is it possible just by code r…