Skip to content

Tag: sql

SQL Group By Sum and Nulls

I have a query that fetch the sum of quantity of a certain date with a GROUP BY, but the query is giving me NULL results and not aggregating some values. Here is the query: Select VPC.Armazem …

SQLAlchemy substring is in string

I am trying to query a database for records that have a string field inside an input search string. Something like this: Of course that does not work since it is not a valid SQLAlchemy statement. This seems a simple problem but I really can’t find the right column operator. I tried the in_ operator: But…

Postgresql ON CONFLICT in sqlalchemy

I’ve read quite a few resources (ao. 1, 2) but I’m unable to get Postgresql’s ON CONFLICT IGNORE behaviour working in sqlalchemy. I’ve used this accepted answer as a basis, but it gives I’ve tried adding the postgresql dialect to the @compile clause, renaming my object, but it do…

What does VARBINARY(MAX) mean?

I’m trying to port a MSSQL database over to MariaDB and I’ve encountered a table creation using varbinary(max): What would this actually do and is there an equivalent type definition in MariaDB that I could use? Answer As others have stated in the comments, VARBINARY(max) in MSSQL refers to: Varia…

SQL “IS NOT NULL” compensation for SAP HANA SQLScript

Actually I tried to run a is null SQL Statement on a SAP HANA Database using the SAP HANA Studio. This does not work because SQLScript has no is not null or is null function. My statement looks like: Unfortunately it does not work. Does anybody know an alternative approach which is practicable using SAP HANA …

Sql arithmetic overflow

I have this query: Insert into Course(name,age,id,facebookuser) Values(‘Example’,25,204813,blalbla@walla.com), (‘Exmnumtwo’,35,504813,email@walla.com) Which gives me the error 8115: “arithmetic …