CinderellaMGS.SQL_Queries.getCurrentlyShopping C# (CSharp) Method

getCurrentlyShopping() public method

Retrieves a dataset of those who are currently shopping.
public getCurrentlyShopping ( ) : DataSet
return System.Data.DataSet
        public DataSet getCurrentlyShopping()
        {
            string sql = "Select FairyGodmother.lastName + ', ' + FairyGodmother.firstName + ' :: ' + Cinderella.lastName + ', ' + Cinderella.firstName as PairName  From CinderellaFGPairing INNER JOIN FairyGodmother ON CinderellaFGPairing.fairyGodmotherID = FairyGodmother.ID INNER JOIN Cinderella ON CinderellaFGPairing.cinderellaID=Cinderella.ID Where fairyGodmotherID IN (Select FairyGodmotherTimestamp.fairyGodmotherID From FairyGodmotherTimestamp,(Select ID, lastname + ', ' + firstname AS Name FROM FairyGodmother) n, (Select fairyGodmotherID, shiftID From FairyGodmotherShift) b, (Select fairyGodmotherID, max(timestamp) as TimeStamp FROM FairyGodmotherTimestamp Group BY fairyGodmotherID) a Where a.fairyGodmotherID= FairyGodmotherTimestamp.fairyGodmotherID and a.timestamp= FairyGodmotherTimestamp.timestamp and n.ID= fairyGodmotherTimestamp.fairyGodmotherID and b.fairyGodmotherID = FairyGodmotherTimestamp.fairyGodmotherID and FairyGodmotherTimestamp.status = 'Shopping')";
            return database.getDataSet(sql, "tableName");
        }