query result that depends on the count of matching field contents in one record

Ralf Sander ralf at end-if.de
Sat May 7 01:47:33 CDT 2005


Hi Ivan,

I am thinking of an image retrieval system based on color values. I 
will have 3 color values for several sectors of an image. To avoid 
leaving out runaways, I thought it would be a good idea to have the 
possibility not to match all sectors. Also the sensibility should be 
customizable, so I need to query ranges.
There could be a lot of fields (sectors * 3 colors + brightness and 
your suggestion would be result in a little too long query string, I 
think.
But maybe you have another hint.

Thanks,
Ralf


> Hello Ralf,
>
> Saturday, May 7, 2005, 1:28:10 AM, you wrote:
>
> RS> Hi,
>
> RS> I want to create a search where I get a result that depends on the
> RS> count matching field contents in one record. But I can't get it. 
> May
> RS> be, I am thinking in the wrong direction.
> RS> Lets assume, I have a table with 4 fields (vshort). Now I want to 
> get
> RS> all records where more than 2 field matches a condition.
>
> Sorry for prev. post. Just misreading some parts.
>
> So - "WHERE" clause is predicate which is applied for each
> "candidate" record. If it calculates true - record would be included 
> to the
> result.
>
> You want to have some condition like - "at least 3 fields matches..."
> It sounds very strange. I can't imagine what it can be for.
>
> But, actually you need to enumerate ALL field-triads in "where" clause
> in such a way:
>
>
> WHERE
>      ( f1 = ... AND f2 = ... AND f3 = ... )
>      OR ( f1 = ... AND f2 = ... AND f4 = ... )
>      OR ( f1 = ... AND f3 = ... AND f4 = ... )
>      OR ( f2 = ... AND f3 = ... AND f4 = ... )
>
>
>
>
> -- 
> Best regards,
>  Ivan                            mailto:IvanSmahin at public.kherson.ua
>
> _______________________________________________
> Valentina mailing list
> Valentina at lists.macserve.net
> http://lists.macserve.net/mailman/listinfo/valentina
>



More information about the Valentina mailing list