Skip to content

Check if NULL exists in Postgres array

Similar to this question, how can I find if a NULL value exists in an array? Here are some attempts. Only a trick with array_to_string shows the expected value. Is there a better way to test this? Answer Postgres 9.5 or later Or use array_position(). Basically: See demo below. Postgres 9.3 or later You can te…

Find all tables that have ROWGUIDCOL

IS there a system table I can join to so I can query to find all tables with a column flagged as ROWGUIDCOL? thanks! Answer You could utilize sys.columns with COLUMNPROPERTY: SqlFiddleDemo Output:

print SQL output in jade file

I’m trying to output an sql query in Jade file. I got it so far that I can print plain text to jade but when I try to put an output from SQL it doesn’t work can someone help me. The code in app.js (…

Retrieve Oracle last inserted IDENTITY

Since Oracle 12c we can use IDENTITY fields. Is there a way to retrieve the last inserted identity (i.e. select @@identity or select LAST_INSERTED_ID() and so on)? Answer Well. Oracle uses sequences and default values for IDENTITY functionality in 12c. Therefore you need to know about sequences for your quest…

Getdate(), -1 day

I do not understand why, but somehow this query doesn’t work. I want to take system date -1 day where the sysdate is smaller by 1 day then current date. WHERE a.SEND_Date >= dateadd(DD,-1,(…