code: def limitsSql(startIndex=0, maxResults=0):
      
      if startIndex and maxResults:
          return " LIMIT {}, {}".format(startIndex, maxResults)
      elif startIndex:
          raise Exception("startIndex was provided, but maxResults was not")
      elif maxResults:
          return " LIMIT {}".format(maxResults)
      else:
          return ""
docs: Construct a SQL LIMIT clause