Questions tagged [multi-table]

138 questions
0
votes
2 answers

PHP SQL: Matching corresponding Data between 2 tables, without Filtering out Data in 1st Table

I have 2 tables. For simplicities sake 'u' has the following columns userid divisionid 'd' has the following: divisionid name I did not create this table, otherwise I would not have this problem. u.DIVISION can be NULL. d.DIVISION cannot. Running…
Flarex
  • 531
  • 6
  • 16
0
votes
1 answer

Performing a Multitable Query without Cartesian Product

Just learning MS Access 2013 and feeling stuck with how to retrieve the data I want using a multitable query. I have two tables: one stores a list of organizations and the other stores a list of individual names. In a third table, I have a lookup…
Ryan
  • 3
  • 1
0
votes
2 answers

Insert values of specific columns from one table to specific columns in another table

I have two table in SQL, each having 12 and 16 columns respectively.Out of these 4 are common in both. What I need is that I want values of these 4 columns from one table to be inserted to the columns in another table. I tried the following: INSERT…
Jackson Lopes
  • 215
  • 1
  • 5
  • 20
0
votes
2 answers

SQL Query - compare row values

Ok, so here is the problem I have two tables in my SQL DB. Table 1 is a simple contact table with a record for each individual in my DB. Table 2 is an education/Exam table where there is a single record for each individual in the DB but each…
0
votes
0 answers

Selecting the right type of subclass in a multi-table inheritance scheme in Django

I'm trying to implement a multi-table inheritance class hierarchy in Django (1.7). My models can be simplified to these: PARTY_TYPES = ((1, "Person"), (2, "Organization")) ORGANIZATION_TYPES = ((1, "Private"), (2, "Governmental")) class…
0
votes
2 answers

How should I design an interface for multi-table CRUD?

I'm designing a fairly complex web application using MySQL and PHP, and I need to write a CRUD interface for the database. I have many tables, with various one-to-many and many-to-many relationships between them. To keep things simple, let's focus…
alexw
  • 8,468
  • 6
  • 54
  • 86
0
votes
2 answers

Update multiple rows in table based on conditions from another table

Just demo. I have two table Table a (id, name) --id---name---- 1 John 2 Jack 3 Maria 4 Bill Table b (id, empid, datewrk) --id---empid----datewrk---- 1 1 2012-12-12 2 2 2012-12-14 3 3 2012-12-16 4 …
QHu91_IT
  • 189
  • 2
  • 12
0
votes
3 answers

Output two columns mysql

I got mySQL query like this: SELECT * FROM products_description pd LEFT JOIN products zp ON pd.products_id = zp.products_id LIMIT 0 , 1000 This simply joins two tables together, and outputs columns and rows based on the same product id. Now…
pasujemito
  • 312
  • 4
  • 16
0
votes
2 answers

Multi-table database SQLite android

I'm new with database (SQLite) and I'm trying to do a multi-table database in android. Each table has the same rows (id, name , ph_number). Every tables store a "contact" object. When I want to store a contact in one table with the method…
Alberto
  • 25
  • 1
  • 4
0
votes
2 answers

SQL Server : sum rows from different tables

Table 1: item Purchase price ------- -------------- item1 10$ item2 20$ item3 30$ Table 2: item Sale Price ------- -------------- item1 10$ item2 20$ item3 30$ I want the following result: row name item1…
amid
  • 23
  • 6
0
votes
0 answers

Update multi table access db using vb.net

Can someone please help me with that? My prob is that When i use dataAdapter.Update in this next construction i get a return value of zero (no line was updated but no reason or errors return). The update sentense works when i run it using Access…
Avishay
  • 305
  • 1
  • 11
0
votes
3 answers

Return records from master table having particular records in detail table

i have following two case-tables. tbl_emp is master table, say:- ---------------------------------------------------------- tbl_emp ---------------------------------------------------------- emp_id emp_name 1 …
learner
  • 757
  • 2
  • 14
  • 35
0
votes
1 answer

Retrieve the Table Names in a Query that Searches multiple tables

How can I modify the following query code to include the table names in the results? The $query searches 4 tables in the database and I want the results to include which table they came from. All 4 tables have identical fields. I then want to output…
Sammy
  • 877
  • 1
  • 10
  • 23
0
votes
0 answers

SQL How to query 2 tables with no relationship between them

I have 2 tables. The output I need is: Supplier_id supplier_name Grade_id grade_name customer_name customer_id Query I am using is: select distinct gs.Supplier_id,s.supplier_name,gs.Grade_id,g.grade_name, c.customer_name,c.customer_id from…
0
votes
1 answer

What's the most optimised MySQL query for these three tables?

I have four tables (but I'll query only three of them): Articles (article is an 'item', type 6): *a_id, a_title, a_text* Keywords (if a keyword is for articles, its type is 6): *kw_id, kw_type* Keywords_Translation *kw_id, language_id,…
user823871