Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9091

Re: Most elegant way to check if select-option has a single value.

$
0
0

This works functionally to select exactly one document, but it does not help if the check is for performance reasons. Suppose I select on a non-key field - there may be one document at the very end of the search, but the runtime would be horrible.

 

I like the parameter idea though. It would also take care of the field exit (leading zeroes) but have a good performance.

 

If the select-option is a given, you can loop and pick the first/last value for a SELECT with 'EQ'.

 

Wolfgang


Viewing all articles
Browse latest Browse all 9091

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>