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
1 answer

How to query multiple tables and collate data

I am trying to make a notification list that displays notifications from multiple different content types and there respective database tables.for each content type There is a subscribe table with the respective subscriptions which I need to…
Malcolm
  • 23
  • 6
-1
votes
1 answer

Joining multiple tables in MySQL

I am trying to join multiple tables in MySQL, here is the query: SELECT p.post_title , p.post_content , p.guid , i.guid , m.meta_value FROM twypl_posts p JOIN twypl_posts i ON i.ID = p.post_parent JOIN twypl_postmeta…
Ali Elkhaiat
  • 57
  • 1
  • 9
-1
votes
1 answer

How to get multiple values from multiple tables in one db?

i have a serious problem! I want to use different values from different tables in my database. My tables: users user_id | name | email | password | color | created parents parent_id | email | password So, i want to connect these tables with email…
K. Ayaz
  • 21
  • 6
-1
votes
1 answer

How to scrape multiple tables in R?

I am a "newbie" when it comes to R, but i would really like to know how do i scrape multiple tables (that i don't know the dimensions of) from a site like: https://en.wikipedia.org/wiki/World_population (just to be specific, here's is what the code…
KingMaker
  • 49
  • 2
  • 8
-1
votes
1 answer

How can I make a stored procedure to update one column in one table based on the order of rows from another table?

I have two tables Users: user | name | country | rank | country_rank | points 1 | frank | US | to be determined | to be determined | to be determined Awards: awarded_to | points_awarded 1 | …
-1
votes
1 answer

How to Update Multiple row table using this approach?

It display the result. but when I'm updating it doesnt work. my multiple table results (working). prepare("SELECT * FROM famcomp WHERE app_id='".…
kim de castro
  • 299
  • 6
  • 19
-1
votes
3 answers

How to update multiple table row array in php mysql

it display the record but when I save it. it doesnt work. please have a check on my array query.
kim de castro
  • 299
  • 6
  • 19
-1
votes
1 answer

Select SQL with multiple tables in Access 2010

Two database tables: Continent table with ContinentID and ContinentName columns City table with CityID, CityName and ContinentName columns Situation: I want to combine the corresponding city to its continent. Like Europe (continent) has Denmark…
Kindess
  • 49
  • 6
-1
votes
1 answer

IF user type = 1 then select form table 1 else select form table 2

i need a mysql query that can query the result like if user type =1 then select form table one else select form table 2 please help me to build this query
Mohd Sadiq
  • 181
  • 1
  • 2
  • 16
-1
votes
2 answers

Sql Server update based on an aggregate from two tables with two variables each

this is my first time posting a question and I hope not to waste any of your time. Thanks in advance for any help. I am attempting to calculate the distance between every zip-code in the United States and a list of 495 buildings (384 unique). I…
Nathan
  • 1
-1
votes
1 answer

Multiple tables MySQL query

In continuation with previous question, I need to display score below query does not work Question is here : Question 1 INSERT INTO TblScore (ScoreID, TeamID, MatchID, Score) VALUES (1, 1, 1, 5), (2, 2, 1, 6), (3, 4, 2, 15), (4, 3, 2,…
Danish
  • 115
  • 7
-1
votes
1 answer

Error Coalesce cant link inside Inner Join

Actually i have a Oracle 10 and MSSQL Databases where i use this query: SELECT F1.ID_ACTIVO, F1.DENOMINACION, F1.IMPACTO_TOTAL, F1.RIESGO_TOTAL, AIRR.ID_RANGO, SUM(IMPACTORESIDUAL), SUM(RIESGORESIDUAL) FROM ( SELECT AA.ID_TIPOACTIVO, AA.ID_ACTIVO,…
S. Moreno
  • 526
  • 2
  • 7
  • 29
-1
votes
1 answer

Select limited and ordered records from first table matching with second table

I have two tables: threads and comments Threads: id author_id Comments: thread_id author_id thread_id in Commets table is linked to id in Threads table. Initially i have author_id of user, that posted some Comments in several Threads. I want to…
user3921055
-1
votes
1 answer

MySQL: Multiple table join

I got a system to request tours for drivers. If more than one driver requests the same tour it goes to the one who started to work with us first. If they started on the same day I need the birthday so that the oldest one gets the tour. Table 1:…
-1
votes
3 answers

pulling values from two tables after Select distinct id on another table

Having sensors spread around my house, they all send data to a mysql DB. Sensors send multiple samples per communication with the DB that occur every 5 minutes. On table 'sensors' I have generic sensor info (primary key SensorId) I need to pull the…
Afonso Gomes
  • 902
  • 1
  • 14
  • 40