I have a following result set: req_id | p_id | ai_result | hash | sku 1 | 4 | Match | XAN | HOW 1 | 4 | Match | HXN | HOW 1 | 4 | Non Match | 123 | …
Tag: sql
Query columns based on values of table
I’m new to DB and SQL so I don’t know if there is anything new I need to try for this. I want to solve this table my senior has given to me: Passbook(Table Name) Date | Amount | Type ———-…
How can I delete or update a record sql from JTable in Java Swing
I’m coding on a java Swing sql project. I’m stuck at deleting and updating an information record. I can add a new record normally but can’t update or delete one. When I delete, it will notify ‘can’t …
Counting How ID has Same Join Combination?
I has Join table, and result is like this IDA IDB QTY A 3 1 A 4 1 A 5 1 B 3 1 B 4 1 C 3 2 D 3 2 E 3 1 F 4 1 G 3 1 G 4 1 G 5 1 H 3 3 H 4 3 H …
SQL Select: Evenly Distribute Results Set
I have a table called TableA, with a Color column. Nine rows total, if I select * from TableA order by Color, I get results set blue blue blue green green green red red red how do I distribute …
How to delete records from a table if they don’t meet a condition in another table
I have two tables, company and company_name. company contains the columns: company_id(primary key) and company_name, while company_name contains the columns: company_id(foreign key from company table),…
Performance for Avg & Max in SQL
I want to decrease the query execution time for the following query. This query is taking around 1 min 20 secs for about 2k records. Numbers of records in table: 1348474 Number of records processed through where query: 25000 Number of records returned: 2152 I tried removing the AVG & MAX columns and it lo…
‘CREATE TABLE’ generates Run-time error ‘3290’
I have a syntax issue in the first CREATE TABLE statement. I’m receiving the following VBA error: Run-time error ‘3290’ The goal is to move the distinct data to a new table dependent on values in …
Violation of uniqueness in primary key when using inheritance
I’m using inheritance in PostgreSQL but there is a big problem while using it. I have a Parent table and 2 Child Tables and I don’tknow how to insert a data in these tables. The uniqueness of Parent …
how to pick the column with the highest value
I have a table with different possibilities of marital status (columns), how do I pick up the one with the highest value and keep the column name? For example, below is my original data set: data …