You are looking at many info about querys

cowmand mode query

Provides user-definable queries of the entire object database.

You need to define some variables, otherwise the defaults will be used:

$flds a list of fields separated by commas
$flds = "obj_id,class,name,material";
default is 'obj_id,class,name,material'

$where the sql where clause which can include 'order by'
$where = "class like '%mouse%' ";
default is "class like '%fig%'"

Other variable which provide more flexibility:
$title a title you can give to your query results
$title = "All objects called `mouse` ";
default is 'A collection of objects'

$table allows complex table selection with linking
$table = 'objects as o left join objects as l on o.obj_id = l.loc';
default is 'objects'

$limit limits the number of rows returned
$limit = 9999;
default is 100

Some simple examples:
Show default fields for 100 objects what are black:

$where = "colour = 'black'";
mode query;


Show specific fields for objects what are black, ordered by their worth in descending order:

$fields = 'obj_id,material,colour,code';
$where = "colour = 'black' order by worth desc";
mode query;


Some complex examples
The titles describe what they do. Notice that once we start linking tables we have to use the o.and l. aliasing everywhere, and we have to specify $table, $flds, and $where as the defaults will cause the sql to break.

$title = 'Objects with a skill (200 only)';
$table = 'objects as o';
$flds = 'o.obj_id, o.class, o.name, o.skills, o.skillvals';
$where = 'o.skills <> "" order by o.class, o.name';
$limit = '200';
mode query;



$title = 'All objects hosting an object called `aim` or `dodge`';
$table = 'objects as o left join objects as l on o.obj_id = l.loc';
$flds = 'o.obj_id, o.class, o.name, o.creator, o.material, l.obj_id, l.class, l.name';
$where = "l.class rlike 'aim|dodge' ";
$limit = '9999';
mode query;

Note: each value is shown as a link to find that value.. watch out if its something common like 'player' as you will end up finding all 600 players. Fr this reason its very handy including obj_id in your field list so you can click on this to get directly to each object.