Question: I have a stored procedure that selects some data in a different format from my original table:

```
USE [VolTracker]
GO

DECLARE @return_value int,
        @offset int

SET @offset = 5

WHILE @offset >= 1 BEGIN
    EXEC    @return_value = [dbo].[sp_getStats]
            @Doffset = @offset,
            @StartTime = --Some Datetime,
            @EndTime = --Some later Datetime,
            @Contract = NULL

    SET @offset = @offset - 1
END

GO

```

This specific example selects all 5 of the tables that I would like it to properly. However, I would like all of these tables joined into one table. How might I go about doing this?

Answer: 
Assuming I understand what you're trying to do, you are not joining your tables properly. Try joining one at a time

```
SELECT DISTINCT monthlyreturns.categoryid, monthlyreturns.month, monthlyreturns.quarter, monthlyreturns.year,paym entnotification.amount, users.pname, monthlyreturns.ototal, paymentnotification.payee, status
FROM paymentnotification 
INNER JOIN monthlyreturns
ON paymentnotification.categoryid = monthlyreturns.categoryid
INNER JOIN users 
ON monthlyreturns.categoryid = users.categoryid
ORDER BY monthlyreturns.categoryid DESC

```
I don't see any problem.. I get 4 result rows: check this fiddle <http://sqlfiddle.com/#!2/165a22/5>

this is the query I used:

```
SELECT m.categoryid, m.month, m.quarter, m.year,p.amount, u.pname, m.ototal, p.payee, m.status
FROM paymentnotification p JOIN monthlyreturns m ON p.categoryid = m.categoryid
JOIN users u ON u.categoryid = m.categoryid
ORDER BY m.categoryid DESC

```

there are no duplicated rows, just "unique" rows if you consider every column you choose.

Hope it helps