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
0
votes
2 answers

MYSQL Multiple Table

I want to use multiple table to get recent post (Q) and user name (handle) but when I am trying to get with this code it is giving error Table Name qa_posts and qa_users and need to connect userid from qa_posts to handle from qa_users SELECT * FROM…
Code Lover
  • 8,099
  • 20
  • 84
  • 154
0
votes
1 answer

MYSQL Searching multiple tables in a specific order

I had previously asked a question MYSQL Searching multiple tables with different columns using LIKE Which I was unable to get help on: so I'm compromising. Right now if a person makes a search and its found in multiple tables it does not search them…
Jweb
  • 47
  • 5
0
votes
6 answers

MySQL SELECT when not null

I am trying to make a query where 3 tables are being used. The first, table1, is used to store id values for table2 and table3 as well as some other data. In some cases there are no values stored in either of table2 or table3, some cases involve one…
The Thirsty Ape
  • 983
  • 3
  • 16
  • 31
0
votes
1 answer

Mysql View with conditional column

This must be easier than I am making it, but I am going crazy here. What I want to do is create a view from three tables, like such: SELECT tableA.name, tableB.id, tableB.categoryID, tableC.categoryParentID FROM tableB, tableA where…
dgo
  • 3,877
  • 5
  • 34
  • 47
0
votes
1 answer

Code igniter shopping cart joining and selecting from multiple tables

I'm learning code igniter and I'm currently trying to create a shopping cart that works over multiple tables. I can make it so it works using 1 table but when I try the JOIN method it always gives "Product does not exist". The model I'm using…
0
votes
1 answer

Find non-duplicate records from multiple tables

I searched though the internet but could not found what i was looking for, may be because i dont know what to search. My problem is to get non-duplicate records from multiple tables... Say if i have two tables as…
Hasitha Shan
  • 2,900
  • 6
  • 42
  • 83
0
votes
1 answer

multiple count statements in 1 sql query without subselect

Is it possible to do this query WITHOUT using a subselect? tables user: id name value_type_1 id user_id value value_type_2 id user_id value I would like a sql query that would return: id | name | Count(value_type_1) | Count(value_type_2) 1 …
0
votes
0 answers

SQL SELECT multiple SUM for two tables

I have two SQLite tables: Workouts: WorkoutID WorkoutDate 1 25.01.2012 2 19.04.2012 WorkoutExercises: ExerciseID WorkoutID Muscles Exercise Set1_Rep Set1_W Set2_Rep Set2_W 1 1 …
milo2011
  • 339
  • 1
  • 9
  • 25
0
votes
1 answer

Listing matched and Unmatched records in a database

I have a query that will check a table for a voided invoice, and then check the same table to see if the voided invoice was re-tendered. What i'd like to know... is, is there a way to add a column to see If a voided invoice was NOT re-tendered, and…
Shmewnix
  • 1,553
  • 10
  • 32
  • 66
0
votes
2 answers

Unify these 2 queries that use 3 tables

I am working in a group and group membership functionality Tables relevant are: usuarios (id, first_name, last_name, ...) groups (id, name, .. , id_user ) group_members (id, id_group, id_user) With this Design i need to get the creator from the…
Toni Michel Caubet
  • 19,333
  • 56
  • 202
  • 378
0
votes
1 answer

How to show description fields from related table

Just started playing with Ruby (no IT background) and until now went it quite well. But since two days I'm stuck and don't understand what's going wrong... so many thanks already for helping me out with this problem!! The situation is as described…
0
votes
1 answer

How to execute a multi-table query in code-first approach of Entity Framework?

If I want to execute a query that is based on joins between multiple tables, then how would this be coded in a code-first approach using Entity Framework 4.1? For example, I want to execute the following query: SELECT p.ProductId , p.Name AS…
Sunil
  • 20,653
  • 28
  • 112
  • 197
0
votes
4 answers

How to take some column from three table in mysql

i have three table like: table 1: |A|B|C|D| table 2: |A|E|F|G| table 3: |G|H| what i need in result is: |A|B|C|D|H| initially i check only the first two table taking, from table1 all the rows and from table2 the column G in that rows that…
Jayyrus
  • 12,961
  • 41
  • 132
  • 214
0
votes
1 answer

MYSQL query with multiple wheres from same table

So i have two tables jobs and contacts and Im trying to make a row that shows jobs that shows the job location and the tech assigned. Right now contacts can be techs or job locations I would like to keep it that way but can changed if needed. What…
sealfab
  • 489
  • 2
  • 6
  • 10
0
votes
2 answers

Trying to update 3 tables with 1 query [in vain]

When i want to populate my grid I use this Select command : SELECT t1.Id, t1.emertimi, kredite, pershkrim, Viti, t2.Emertimi as Expr1, emri, mbiemri FROM Kurse as t1 INNER JOIN Deget as t2 ON t1.degID = t2.Id INNER JOIN Pedgoge ON t1.Id…
stevenll
  • 1,025
  • 12
  • 29