824 questions
2
votes
2
answers
94
views
Update values from a column of one table if they exist in another table's column if these values are unique
I have a column filled with values that need updating because they are too ambiguous and I want to update these values with values from another table columns.
Player Table:
ID
Email
FirstName
1
Bob....
2
votes
1
answer
62
views
Oracle hierarchical query joining 2 tables
I have 2 tables: projects and tasks (that's a simplification, but will do for now). PROJECTS has a hierarchy of projects where there can be a detached (standalone) project or a projects hierarchy. ...
0
votes
2
answers
107
views
How to avoid Multiple Tables Union All
I have a table called TblVesselEngineSummary, which has a field called EngineConfiguration containing these values
'Single' - Single Engine
'Twin' - Double Engine - two records needed
'Triple' - ...
1
vote
3
answers
153
views
Read Tab-Delimited Text File with Multiple Tables, Python/Pandas
I have a tab-delimited text file that contains multiple tables. There are 13 known tables and each table has a set number of know columns (different number of columns for each table). However, each ...
-1
votes
2
answers
88
views
T-SQL to union data from multiple tables dynamically
I have tables with names:
DeviceLogs_1_2023
DeviceLogs_2_2023
Every month new table is added in database.
How can I create a procedure to combine data from multiple tables into one table or view?
...
-2
votes
1
answer
61
views
Update table getting values from three joining tables [closed]
I was trying to run an update for the column that belongs to the table INVOICE with the data of another table RECEIPT e.g. INVOICE.field1 = RECEIPT.field1, however there is no direct relationship ...
0
votes
3
answers
78
views
SQL: Query multiple tables with a conditional result field (Sorry I don't even know how to ask it correctly)
Taking into account the following example tables:
USERS:
id_user
name
1
Paul
2
Caroline
TRAVEL:
id_travel
id_user
1
1
2
1
3
2
TRAVEL_DAYS:
id_tdays
id_travel
day_has_activities
1
1
no
2
1
no
3
1
yes
4
...
0
votes
1
answer
353
views
Plpgsql, how to insert a new row in multiple tables?
I have a supabase plpgsql data base with 10 tables. I also have the auth.users. I'm trying to write a function which will insert a new row in each of the 10 public.tables when a new user signs up. ...
0
votes
0
answers
72
views
Handling multiple Fact Tables with different Aggregation
I have 2 dim and 2 fact tables with the following model:
So the problem I get is in vizulising both fact values in one Visual without grouping (don't want to MAX or SUM the BookingDate or costs).
...
0
votes
0
answers
49
views
Laravel how to find multiple counts on same field of a table with a join on another table having multiple groupBy
I have two tables:
Table-1: user_invitations
user_invitations table
id
user_id
email
1
1
[email protected]
2
1
[email protected]
Table-2: users
users table
id
email
101
upton.ellis@example....
1
vote
1
answer
101
views
How to query table, using a where clause consisting of another table's data?
I can work on this problem by using either pandas or sql queries.
Say I have two tables or dataframes. The first functions as a description of an observation so to speak. It is indexed by the id I am ...
0
votes
0
answers
34
views
Django ORM issue for multiple tables
This is school project university seat managaement, we have tables for city, then have localaity each city can have multiple locality, locality will have mutliple schools and scholls will have ...
0
votes
1
answer
87
views
count multiple tables in sql
I have a database that has a table for each day making it a huge database consisting of so many months and even years. Now, I wanna count the records of all the tables in each month. I mean, I want ...
0
votes
0
answers
54
views
Insert data to multiple tables takes too long and eventually the route stops responding
I created a customer module from a single form consisting of two tables, the customer table (company) and the person_in_charges table (adding several PIC data for one customer data with a maximum of 5 ...
0
votes
2
answers
84
views
Update with multiple joins in MySQL
I'm having a problem updating tables in a MySQL database (InnoDB).
I have three tables
1-orders Table
orderId
userId
status
7
4
bending
8
4
bending
2- orderedProducts
orderId
productId
quantity
7
22
1
...
1
vote
1
answer
118
views
SQL count from multiple databases and insert with database name
Trying to count from multiple databases (which I'm able to do), but I'd like to have the count results in a table near the database name.
My end result would be:
DbName
unarchived_measurements
hdb1
10
...
0
votes
0
answers
75
views
How do I return JSON data from stored procedure via MySQL Workbench to NodeJS API
I have created a stored procedure, which has a task to return category related information from serveral tables. Also the SP will do some logic, filtering and mapping. At the end I would like to ...
-1
votes
1
answer
491
views
How to Create Search Bar in ASP.Net Core, if we have our list view using StudentCourseViewModel
I have Student Table from database contains Student Roll No, Name, Mother Name, Class, Age, Fee Paid, CourseID(fk), IsActive
in Course Table from database contains courseid(pk) and Course Name, ...
0
votes
1
answer
180
views
MySQL query to count occurrences from multiple tables
I have a problem when I have to select everything from one table (persons) then count how many objects they own by counting their occurrences on other tables (pens, chairs, books)
The current data is ...
1
vote
2
answers
646
views
Postgres SQL gathering data from two tables using an id from a 3rd table
I have 3 tables;
idmaster
data1
data2
idmaster has every id. I need to count how many times each id exists in both data1 and data2 and output them seperate.
id comes from idmaster. Ideally would ...
0
votes
2
answers
188
views
Select from two tables, one column
Please help me to write a Select :)
I need to return data from two tables: values from table X, but only these which also have value from table Y.
For example in table X values are:
Column A
Column B
-...
0
votes
1
answer
126
views
Compare two tables to get the differences between them
Hello I have two tables:
Table: 1 11_counted_stock
id_counted_stock part_number Number of Tag quantity
1 abcde 2 1000
2 aaaaa 4 ...
0
votes
1
answer
84
views
How to use the 'ranked-model' gem with MTI?
I want to use the 'ranked-model' gem with Multiple Table Inheritance.
My use case looks like this:
class MitarbeiterListeEintrag < ActiveRecord::Base
end
class Mitarbeiter < ...
1
vote
1
answer
47
views
How do I add a column from a different table, to the results of an existing query in sql?
I have two tables CHICAGO_CRIME_DATA and CENSUS_DATA.
I am running the following query:
select count(id) as NUM_OF_CRIMES, COMMUNITY_AREA_NUMBER
from CHICAGO_CRIME_DATA
group by COMMUNITY_AREA_NUMBER
...
1
vote
1
answer
867
views
filter records from two tables using Laravel Eloquent
I have two table shopping_sessions and cart_addresses. cart_addresses is linked with shopping_sessions using foreign key. shopping_sessions table has various columns eg. company_id, is_active, ...
1
vote
1
answer
741
views
Data inconsistencies between two tables
I have an SQL question in which I am struggling to understand and find relevant resources to help me.
The question is:
"Write an SQL query to identify data inconsistencies between two tables.&...
0
votes
1
answer
2k
views
Using SQL check to see if an ID in Table A exists in Table B. If that ID exists in Table B return corresponding value
I have a table call it Table A. Table A with an ID column ID1 associated with a row. That table looks like the following:
ID1
A1.0
B2.0
C3.0
A1.0
...
I have a second table call it Table B that has an ...
0
votes
0
answers
435
views
BigQuery Multi Table has no outputs. Please check that the sink calls addOutput at some point error from Multiple database table plugin
I'm trying to ingest data from different tables with in same database using Data fusion Multiple database tables plugin to bigquery tables using multiple big query tables sink. I write 3 different ...
0
votes
0
answers
738
views
How to trigger VBA to run after refreshing all tables by using the Refresh All button?
I have an Excel workbook containing multiple Query Tables. Each table has its own data link.
To refresh the data in all the Query Tables, I want the User to click the Refresh All button on the Ribbon.
...
1
vote
2
answers
4k
views
SQL Select and Sort from Multiple tables
I have three tables:
Table Clothes
|id | productname | manufacturer | arrivaldate |
+----+-------------+-----------------+--------------+
| 1 | Shirt | MfrA | 5/30/20 |
| ...
0
votes
1
answer
488
views
SQL Count Percentage from Multiple Tables with Where clause
I have three tables:
Table Clothes
id
clothname
supplier
instock
1
Shirt
Venom
Yes
2
Tshirt
Traders
No
Table Toys
id
toyname
instock
1
Car
Yes
2
Ball
Yes
2
Yoyo
N/A
Table Tools
id
toolname
instock
1
...
-2
votes
1
answer
41
views
How can I nest multple tables into one while modifying them?
I have multiple tables which I need to merge into one after performing some operations into each one of them.
A first nesting was achieved thanks to a (working) "WITH" statement:
With
T1 as (...
1
vote
0
answers
37
views
MySQL multiple-table update column assignment order
Reading the documentation
Single-table UPDATE assignments are generally evaluated from left to
right. For multiple-table updates, there is no guarantee that
assignments are carried out in any ...
0
votes
1
answer
524
views
MySQL Join two Tables, give all entries of table 1 [duplicate]
I have three tables.
Table 1: tbl_user
id
username
1
User A
2
User B
Table 2: tbl_location
id
location
1
City 1
2
City 2
3
City 3
Table 3: tbl_userlocation
fk_user
fl_location
1
1
2
1
2
2
Now I have a ...
1
vote
1
answer
2k
views
Multiple Tables for one Django Model
How can I dynamically create multiple tables for one specific model?
I have a model (e.g. "Data") and want each user to get a separate database table for this model.
There will be between 30 ...
2
votes
2
answers
502
views
Multiple DB-Tables in Repository - How to do this?
I have the following Code:
Controller
class UserController {
public function __construct(userRepository $userRepository) {
$this->userRepository = $userRepository;
}
[...]
...
0
votes
0
answers
22
views
How to prohibit addinng attribute to a table if it exists in another
I am searching for a solution for the following example:
I have a relation with Students, one for Professors and one for Books.
Students and Professors can lend books. Each book exists one ONCE.
If ...
0
votes
1
answer
706
views
Select multiple tables with only unique users and ordered by latest id
I have 2 tables, first one is called members:
id name show
1 John 1
2 Wil 1
3 George 1
4 Chris 1
Second is called score:
id user_id score
1 1 90
2 1 70
3 2 ...
0
votes
1
answer
104
views
SQL select - Get all from exams table where examId exists in subjects table, for all subjects that exist in students table for desired studentId
I have three tables: exams, subjects and students.
Students table has foreign key subjectId and Subjects table has foreign key examId.
I need to retrieve all exams for desired studentId. So I need sql ...
0
votes
1
answer
49
views
Joining three tables on two IDs
I have this exercise for an application and I can't really check if I'm doing it right because I'm a beginner and I don't how to make my own database.
These are the given data:
Table 1: Company
...
0
votes
1
answer
77
views
In Sql Server, how can I update Table A record values from multiple records of Table B
TableA:
ID varchar,
Name1 varchar,
Name2 varchar
TableB:
ID varchar,
Name varchar,
Type varchar
I want to update Name1 and Name2 in TableA from TableB when they have the same ID value:
when TableB....
1
vote
0
answers
348
views
Angular DataTables : Multiple datatables individual column filters are not working
Angular DataTables with Angular way, Multiple data tables filters are not working.
I have two tables, and different API's data. Im trying to implement individual column filters. Any suggestion pls...
...
2
votes
1
answer
80
views
Querying multiple MySQL tables based on distinct values, and return the matches count and time difference between first and last record
Question Summary
I need to select all distinct values of column slug in a table, then go through other multiple tables, and for each count the records where slug appears, as well as find the ...
1
vote
1
answer
102
views
Identify latest records from multiple tables and join them all together
I have 5 related tables I am trying to produce a query teport from.
What would be the process by which this can be achieved?
The end result should be:
Last Calving_Date
Latest EC_Date
Latest BScore
...
0
votes
0
answers
353
views
MySQL query in a database of food inventory and recipes
I'm new to mysql and I have to do a kitchen inventory database with recipes for a school project. I'm trying to get a query that shows recipes and users when users have all the ingredients to that ...
-1
votes
1
answer
35
views
Combining the separate queries from multiple tables
Table1
ID | First | Last | Branch
111 Amy A 10
222 Yuki B 11
333 Smith C 10
444 David D 12
555 ...
-1
votes
1
answer
82
views
Listing common data in multiple tables belonging to a category table with MySQL
i have 3 tables. this-> category, blog, course
category table
| category_id | category_name |
| 1 | php |
| 2 | python |
| 3 | javascript |
blog ...
2
votes
2
answers
53
views
MySQL join only when condition is met one time
There probably is a simple solution but I can't wrap my head around it.
Let's say we have 4 tables
persons (id, is_teacher)
persons_relation (id, person_id, teacher_id)
rooms_relation (id, person_id, ...
-1
votes
2
answers
78
views
What will be the correct sql to get the no. of student for individual group?
meetings which looks like this:
meeting_ID
place
1
A
2
B
3
C
study_groups which looks like this:
study_group_id
meeting_id (fk)
topic
1
1
Basics
2
2
Photography
3
1
Film
group_members which looks like ...
-1
votes
1
answer
86
views
SQL LEFT JOIN to table determied by result from inner SELECT
I'm just wondering if this is possible.
I'm trying show all results from one table and grab more details from respective group(table)
+--------------------------+ +--------------------------+
| ...