Skip to content

Tag: sql

List all foreign keys PostgreSQL

I need a query that returns: “table_name”, “field_name”, “field_type”, “contraint_name” until now i have: Answer A foreign key may be based on multiple columns, so conkey and confkey of pg_constraint are arrays. You have to unnest the arrays to get a list of col…

Copy DAO recordset from Excel into Access table

I have searched endlessly for a solution to this but can’t figure it out at all. Any help would be massively appreciated. I currently have some Access VBA code which sets up a DAO recordset connection with a range in an excel worksheet. (I have avoided linking the spreadsheet as a linked table as I am u…

Postgres Left Join with where condition

I need to left join two tables with a where condition: time_table record_table I need to get all those records which are present under given date range. In the above example, I need those records that lie under range for rid = 2 only. Hence the output for the above query needs to be: Answer left join two tabl…

Select from 2 tables with conditions

I need a SQL query, for multiple condition select from 2 tables. I want to get all rows so that I get all order_row rows from table2 which are not present in table1 and order_row rows from table2 whose timestamp is newer in table2 than table1. And checks only rows from table 2 where timestamp is newer than 20…

ADODB Connection to two access database

Due to ms access 2GB limitations on space; i am considering splitting a database into two. However I regularly rely on SQL statements such as the following: Is there a way in ADODB to perform the above, ie INSERT INTO table in file 1, the SELECT data from a table in file 2 ? Answer Here’s an example of …

How do I get a space in my property name?

I have the following query: The problem is that I make the property ProjeAdı in the Select clause. I want the property to match the sql column, Proje Adı (note the space). How can I do that? Answer aliases cant have spaces between them , just like any variable name cant have white space, they are considered a…