Check out this link: http://codex.wordpress.org/Template_Tags/query_posts#Custom_Field_Parameters
Custom Field Parameters
Retrieve posts (or Pages) based on a custom field key or value.
* meta_key=
* meta_value=
* meta_compare= – operator to test the meta_value=, default is ‘=’, with other possible values of ‘!=’, ‘>’, ‘>=’, ‘<‘, or ‘<=’
Returns posts with custom fields matching both a key of ‘color’ AND a value of ‘blue’:
query_posts('meta_key=color&meta_value=blue');
Returns posts with a custom field key of ‘color’, regardless of the custom field value:
query_posts('meta_key=color');
Returns posts where the custom field value is ‘color’, regardless of the custom field key:
query_posts('meta_value=color');
Returns any Page where the custom field value is ‘green’, regardless of the custom field key:
query_posts('post_type=page&meta_value=green');
Returns both posts and Pages with a custom field key of ‘color’ where the custom field value IS NOT EQUAL TO ‘blue’:
query_posts('post_type=any&meta_key=color&meta_compare=!=&meta_value=blue');
Returns posts with custom field key of ‘miles’ with a custom field value that is LESS THAN OR EQUAL TO 22. Note the value 99 will be considered greater than 100 as the data is stored as strings, not numbers.
query_posts('meta_key=miles&meta_compare=<=&meta_value=22');