Hey all,
I'm trying to pull a list of records from a table with ORder infomation. Say our table consists of 2 columns.From the example data below, i want to return all records where there's more than 1 ORderNumbr on a single MoveNumber.
Ex:
MoveNumber OrderNumber
111222 98758
111222 90491
111222 98482
111223 84383
I need to return the first 3 records...
I tried running this script but it's not returning any results:
select movenumber, ordernumber from OrderTable
group by movenumber, ordernumber
HAVING COUNT(ordernumber)>1
It's fine if it returns the same movenumber 3 times; I just want figure out the logic of how to get this to work as i;m using it for a sub-report on an SSRS report.