I am trying to get all rows where the states are greater than 1. My table: user_id|state ————– 1000000|Active 1000000|Created 1000001|Active 1000000|Deleted 1000002|Active 1000001|Created …
Accounting Data Warehouse Design Question
The finance module in our ERP has a general ledger and sub-ledgers (accounts receivable, accounts payable etc.). All the sub-ledgers are rolled up into the GL. Standard accounting schema I believe I …
How to join two tables in one view?
I am trying to create a view where I can see the items that have been planned to be shipped and have not been shipped, and the items have have been shipped but were not planned to. In order to do …
Sequelize Include with Where Condition
I’m having a problem with how to query multiple include with where condition. Tried it using direct query to sql and it works fine. I made a sample using sql and having a problem converting it to …
The operation failed because an index or statistics with name ‘XPKUSERS’
Need help in understanding the error “The operation failed because an index or statistics with name ‘XPKUSERS’” and help in converting the query to TSQL CREATE TABLE TDM_USERS_AUTH ( USER_ROLE_ID …
Avoiding IF statement to control WHERE statement
I have the below code which works and does what it needs to. However, I need to manage two exact queries through an IF statement. Can anyone see a way to do away with the IF ? IF @…
BIGQUERY: Replace a ‘null’ result from one table with a user id from another table
trusty BQ experts. Background: I have users reading articles on a website (User Table A) and users clicking through to articles from an email (User Table B) and have BQ view tables for each user set. …
Unexpected behavior of ARRAY_SLICE in Cosmos Db SQL API
I have Cosmos DB collection (called sample) containing the following documents: [ { “id”: “id1”, “messages”: [ { “messageId”: “message1”, …
Postgres + Node – Parameter Query with $1, $2, $3 giving error
I’m getting this nodejs error when I try running my query with params ($1, $2, $3). The query works in postgres. It also works if I don’t use the params ($1, $2, $3) and instead substitute values in …
Filter out entire records SQL
I have two tables: TableA and TableB TableA Has 10 records while TableB has 8 Records. I am trying to filter the distinct records on table B from TableA so I can then move the discrepancy to TableB….