|
-
Aug 1st, 2012, 10:46 AM
#1
Thread Starter
Member
Need Help With SQL Query
I really need some help. I have two different tables, but I wont to join the two tables together all in one select statement. I have provided in attachment, on how the table look now, in how I'm trying to get the tables.
SQL Table Example.txt
Table 1:
SELECT [SerialNumber]
,[In Stock]
,SerialNumber - [In Stock] as [Short Of]
FROM [phabsproduction].[dbo].[Stock_Inventory]
where
(SerialNumber - [In Stock])<0
order by
[Short Of] desc
Table 2:
SELECT PartNumber,Count(PartNumber) AS Total FROM Stock_Inventory WHERE [PartNumber] like '82480-%' or [PartNumber] like '83480-%' GROUP BY PartNumber
WHAT I WILL NEED FROM THE TABLE 1 ARE THE FOLLOWING; I WILL NEED THIS PART ADDED IN THE TABLE 2 QUERY;
,SerialNumber - [In Stock] as [Short Of]
FROM [phabsproduction].[dbo].[Stock_Inventory]
where
(SerialNumber - [In Stock])<0
order by
[Short Of] desc
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|