i have three SQL server tables like this 
i need to select the categories from LS_categoires where nodeid = 183 and select only 5 files from LS_files that related to each category was selected
if i have two categories related to node 183 the result should be 10 rows
is that possible ?
Try this:
This will select first files for each category.