Result set

A result set is the set of results returned by a query, usually in the same format as the database the query is called on.[1] For example, in SQL, which is used in conjunction with relational databases, it is the result of a `SELECT` query on a table or view and is itself a non-permanent table of rows, and could include metadata about the query such as the column names, and the types and sizes of each column. In an object database, the result set is usually a collection of objects from the database.

Depending on the database, the number of rows in the result set may or may not be known. Usually, this number is not known up front because the result set is built on the fly. A cursor can be used by client applications to fetch a few rows of the result set at a time.[2]

## Sorting

In SQL, there is no guarantee that the rows of a result set returned by a `SELECT` query are in any particular order unless the `ORDER BY` clause is used in the query, which sorts the rows of the result set in ascending or descending order based on one or more columns.[2]

## References

1. ↑ Beaulieu, Alan (2020). "Chapter 1. A Little Background". Learning SQL, 3rd Edition (3rd ed.). O'Reilly Media. ISBN 9781492057611. OCLC 1138944140. https://www.oreilly.com/library/view/learning-sql-3rd/9781492057604/ch01.html.
2. ↑ 2.0 2.1 Database Fundamentals (1st ed.). IBM Corporation. 2010. pp. 122–123. https://my.uopeople.edu/pluginfile.php/57436/mod_book/chapter/37615/CS2203.Textbook.Database.Fundamentals.pdf.

0.00

(0 votes)

Original source: https://en.wikipedia.org/wiki/Result set. Read more

|

Retrieved from "https://handwiki.org/wiki/index.php?title=Result_set&oldid=3983414"