Use this as a substitute for db_query() when a subset of the query
is to be returned.
User-supplied arguments to the query should be passed in as separate
parameters so that they can be properly escaped to avoid SQL injection
attacks.

Parameters

$query:
A string containing an SQL query.

...:
A variable number of arguments which are substituted into the query
using printf() syntax. Instead of a variable number of query arguments,
you may also pass a single array containing the query arguments.
Valid %-modifiers are: %s, %d, %f, %b (binary data, do not enclose
in '') and %%.

NOTE: using this syntax will cast NULL and FALSE values to decimal 0,
and TRUE values to decimal 1.

$from:
The first result row to return.

$count:
The maximum number of result rows to return.

Return value

A database query result resource, or FALSE if the query was not executed
correctly.

Thank you for offering an example. However, in the interest of illustrating the actual underlying API, the second parameter to db_query_range() should be the argument list for the query. In the case of your example, it would be:

db_query_range("SELECT nid FROM {node}", array(), 0, 6);

Or, to use an example with an actual argument list:

// Select only the first result by using LIMIT = 1
db_query_range("SELECT nid FROM {node} WHERE title LIKE '%s%%' and created > %d", array($title_fragment, $timestamp), 0, 1);