Questions tagged [multiple-tables]

This tag will generally be used by those unfamiliar with SQL, asking basic questions about joins. In SQL, data is stored in tables. Frequently, queries need data from multiple tables, and the way that they are connected may not be obvious.

823 questions
-1
votes
2 answers

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

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) +--------------------------+ +--------------------------+ | table group_a | | table group_b …
-1
votes
1 answer

MySQL select query on multiple table does not display the comm data

here is my current query and it access four tables. Everything else displays the correct data except for this part: IF(tbl_shift.commission IS NULL,'0.00', (tbl_shift.commission*tbl_payment.subtotal)) AS comm, this doesn't seem to access the data…
Cei
  • 1
  • 1
-1
votes
1 answer

Mysql select with multiple tables and multiple foreign keys

If I have three tables like: suppliers (sID: integer, sName: varchar, description: varchar); With sID as primary key +-----+-----------+-------------+ | sID | SName | description | +-----+-----------+-------------+ | 1 | Supplier1 | Desc1 …
GhostUser
  • 33
  • 1
  • 5
-1
votes
3 answers

How to join multiple large tables using Google BigQuery

I'm trying to left join multiple large tables into one large table using Google BigQuery so that it will be processed more easily in Tableau. I've ordered the files by size (131 MB to 20.2MB and one 3.96KB) in the query and changed my left join…
Hatim
  • 1
  • 1
-1
votes
2 answers

Combining Two Tables and Working with the Results

I have two tables (Courses, and Enrollment). What I need to do is compare them and perform an action based on my results. Both tables contain the column "CourseID". Courses (Table A) shows the user a full list of the courses available. Enrollment…
C.McP
  • 1
  • 2
-1
votes
2 answers

Getting all records from INNER JOINS of multiple tables

I have three tables tblCourse , tblDegree , tblStudent. I have created a course and degree relation table as like tblCourseDegreeRelation. This relational table uses foreign keys of course and degree table as like: The tblCourseDegreeRelation table…
user1773603
-1
votes
1 answer

Limit number of results from 3-table join

I have 3 tables: SWPPP_SITE, SWPPP_TRACKING, and LKUP_CONSTRUCTION_STATUS. The SWPPP_SITE is 1:many with SWPPP_TRACKING. The SWPPP_SITE is 1:1 with LKUP_CONSTRUCTION_STATUS. I'm trying to select 1 record for a unique site for all sites. This query…
-1
votes
2 answers

Can I use the same recordset variable on different tables?

I am new to Microsoft Access. How can I use the same recordset variable on different tables?
user596226
  • 1
  • 1
  • 1
-1
votes
3 answers

Column from another as parameter SQL SERVER

I have 2 table like this: Table_Work Name Date =============== Andy 1 Jan Andy 2 Jan Andy 3 Jan Ana 1 Jan Ana 2 Jan Ana 3 Jan Ana 4 Jan and Table_Salary Name Salary ================= Andy …
Tommy Sayugo
  • 375
  • 2
  • 5
  • 16
-1
votes
2 answers

Why am I having an syntax error in my query near "WHERE"? (Multiple tables)

Im still new on this and it's my first time using these multiple tables query. Why am I having such an error? Here is my Code: String selectQuery = " select *" + " from tableassign left outer join\n" + " …
Aya Sato
  • 29
  • 1
  • 9
-1
votes
1 answer

Two UI tableview cells in one controller?

I have two custom table views with two custom cells. self.detourTblView.delegate = self self.detourTblView.dataSource = self self.dropDownLuggageTblView.delegate = self self.dropDownLuggageTblView.dataSource = self And this is how I fill data. func…
Aneef
  • 3,641
  • 10
  • 43
  • 67
-1
votes
1 answer

ORACLE,SQL nested: From Multiple tables, compares, counting

I am working with SQL+ and am having trouble with querying multiple tables, while comparing count values. For example, I want to know the Student Names and ID # that have taken more than 5 exams in high school. Student Names && ID #s are stored…
userJoe
  • 73
  • 2
  • 12
-1
votes
2 answers

Create table using SQL combining column data from two or more other tables

I was trying to figure out how to insert data into a new join table using the column data from two other tables. This seemed at first simple, but wasn't immediately obvious now could I find the solution anyplace. Example: I have tProfiles…
-1
votes
2 answers

MySQL - How to query multiple tables and put results in xls?

I have two tables and I must select some records and put it in xls by using PHP script. I'm try different query but not working. On JOD_users table i need to select id, name, username, email and on JOD_user_profiles i need to select profile_key and…