Quantcast
Channel: Forum Getting started with SQL Server
Viewing all articles
Browse latest Browse all 7129

Get data from different tables

$
0
0

Hi All,

I have 3 tables as follows

tables
FileInfo
Fields
1.FileID
2.FileName
3.ProcessStatus
OrderHeaders
Fields
1.OrdHeaderID
2.FileId
3.ordernumber
OrderLines
Fields
1.OrdLinesId
2.OrdHeaderID
3.MaterialNo

need to get top1 row from FileInfo where ProcessStatus = 0 and pick FileID from that top1 row and need to get all rows which matches FileID in OrderHeaders Table,And based on OrdHeaderID need to pick Material numbers in OrderLines table.

Can any one help to write Sp for this requirement.


panadi


Viewing all articles
Browse latest Browse all 7129

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>