I am working on an application and one step of the processing involves joining drug NDC’s from claim data with a table that contains the NDC along with a variety of other information including unit price, multisource code, and more. The table of claims data looks something like this: It was read into a …
PostgreSQL search lists of substrings in string column
I have the following table in a postreSQL database (simplified for clarity): | serverdate | name | value |————————————- 0 | 2019-12-01 | A LOC 123 DISP | 1 1 | …
Can you name dbplyr’s simulated lazy tables?
dbplyr has some very useful-looking simulation functions so you can write queries while not connected to any real database, but I can’t seem to get actual table names into any of the queries I write …
SQL Join on table with revision dates
I am about to begin working on a solution for my company in SQL that requires me to link product category mappings based on a SKU number. The problem is that the category mappings can change, and they will have a date associated with the change. For example: Product 1 is currently mapped to category A. User r…
Support needed for a query
I need help to finish a SQL Query for a Woocommerce product list. I need this for a wpdatatable sql input. I searched for a example code and have adapted a found code: SELECT p.ID, p.post_title, …
Most efficient way of retrieving data from large number of tables (20-30)
I need to retrieve data from around 28 tables in my java application which I am then going to dump to Elastic Search. I need to use JDBC to query and fetch the data from the database (PostgreSQL in my …
Subtracting a value in a column based on condition using PLSQL
A simple thing to do I believe. Say I have a table: CREATE TABLE kpi ( KPI_ID number(10) NOT NULL, KPI_NAME varchar2(50) NOT NULL, DAY_DATE DATE ); And I know thet someone made a mistake and …
I want this query in Sequelize form
I am getting the output in RAW SQL but I am unable to do with SequelizeJS SELECT * FROM `tbl_a` a LEFT JOIN `tbl_b` b on b.b_uuid = a.a_uuid LEFT JOIN `tbl_c` c on c.c_uuid = a.a_uuid
How to Update the column from another table having minimum value?
Consider table Tax_Details with below details. In this table, each and every Tax_code should have unique Frequency [Tax_Code] [Frequency] A-001 A-002 A-003 B-001 C-001 Consider another table …
I have been looking for solution to get sum of multiple columns(for a single row) in Mysql to get total of every hour for electricity invoice?
I wrote below query to get sum but it is showing(something progressing) total as null for couple of records. It is showing 1064 error at line 4 when I include all records like below. Answer it is showing total as null for couple of records Probably, at least one of the columns has a null value for those recor…