Jump to content

Result set

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by James500 (talk | contribs) at 16:15, 6 May 2015 (Cram101 is not a reliable source. See archive 162 of WP:RSN. The books are mostly copied verbatim from Wikipedia. The passage in the book is copied from an old revision of this Wikipedia article, not the other way round. Copypaste is by them, not us.). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

An SQL result set is a set of rows from a database, as well as metadata about the query such as the column names, and the types and sizes of each column. Depending on the database system, 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 result set is effectively a table. The ORDER BY clause can be used in a query to impose a certain sort condition on the rows. Without that clause, there is no guarantee whatsoever on the order in which the rows are returned.