Hello stackoverflowers,
Forgive me if this question has been asked and answered, I've searched and found a few that look similar but I'm too much of a novice with SQL to adapt them to my needs. Also forgive me if I don't use the correct terminology, I know it can be annoying when someone asks a question and they don't even know enough to be able to ask for what they need.
<2nd EDIT Mar22:>
Ok, I didn't understand what the source data actually looked like, and that is why I couldn't get what I wanted. Thanks to @goran for pushing me to get the real source tables to post here (which I'm still not going to post because I'm too lazy to redact them as appropriate for easy viewing and protection of the innocent, but I should have at least printed them out before asking). Below are newly revised example tables, but I still haven't figure out how to achieve the end goal of getting everything into a single row.
table_one:
id name total
5 John Doe 20
table_two:
id product_id price
5 51 17
table_three:
id text number
5 Subtotal 17
5 Tax 3
5 Total 20
What I'm looking for is something like this:
id name total product_id price text number text number text number
5 John Doe 20 51 17 Subtotal 17 Tax 3 Total 20
I'm no longer certain how valid the information below is, but I'm leaving it here for the moment, hoping it won't confuse new readers of the question too much.
</EDIT Mar 22>
I'm helping a friend gather some data, and need to perform a query that results in a single row per record, but instead I get multiple rows. Here is an example of what I'm querying right now (simplified, hopefully not too much):
SELECT * FROM `table_one` AS t1
INNER JOIN `table_two` AS t2 ON t1.id = t2.id
INNER JOIN `table_three` AS t3 ON t1.id = t3.id
WHERE 1
The result is:
id text number
5 Subtotal 17
5 Tax 3
5 Total 20
What I need is to create a query that results in something more like this:
id text number text number text number
5 subtotal 17 Tax 3 Total 20
Any assistance/guidance would be much appreciated.
Thanks!
--jed