please dont rip this site

ARRAY Predicate

The Array (or Vector) predicate performs comparisons of two arrays using logical operators.

Syntax

Column_Reference Comparison_Operator [ ALL | SOME ] ARRAY [ Array_Elements ]

Elements

Column_Reference  Specifies the column name (alias). Its data type must be compatible with the format of the Array_Elements specified. A column reference can have multiple values, such as in a vector property or file attribute bitmask.
  
Comparison_Operator  Specifies the arithmetic operator to use to compare the Array_Elements. The Comparison_Operator can be any of the following:
  • Equals (=) and not equals (!=).
  • Greater than (>) and greater than or equals (=>).
  • Less than (<) and less than or equals (<=).
  
ALL | SOME  

Specifies how to quantify the Array_Elements. You can use either the ALL or SOME quantifier. If you specify ALL, each element on the left side of the expression is tested by using each element on the right side. If SOME is specified, at least one element on the left side is tested by using at least one element of the right side. For example, the following test fails because element 1 on the left side is less than element 2 on the right side.

[1,2,3] > ALL ARRAY [1,2]

The following test passes because element 2 on the left side is greater than element 2 on the right side (and element 3 on the left side is greater than elements 1 and 2 on the right side, but one passed test is sufficient).

[1,2,3] > SOME ARRAY [2,1]

If the ALL or SOME quantifier is absent, each element in the vector value on the left side of the operator is compared to its right-side counterpart at the same ordinal position. The test begins with the left-most elements and progresses left to right. A test passes if all the individual tests pass. For example, if vectors A[a1, a2, a3] and B[b1, b2, b3] are used, then:

A > B if and only if a1 > b1 , and  a2 > b2, and  a3 > b3

If the first m elements of the vector value on the right match the first m elements on the right side of the comparison operator, then comparisons actually begin with the (m+1)th elements where the values on the two sides differ. If all elements match, then comparison is determined by cardinality, and the one with the higher cardinality is considered greater. The following vector tests all pass:

ARRAY [2,3,4] > ARRAY [1,2]
ARRAY [2,3,4] > ARRAY [1,2,3]
ARRAY [2,3,4] > ARRAY [1,2,3,4]
ARRAY [2,3,4] > ARRAY [1,2,5]
ARRAY [2,3,4] > ARRAY [2,3,3]
ARRAY [2,3,4] > ARRAY [2,3]
ARRAY [2,3,4] < ARRAY [2,3,4,5]
ARRAY [2,3,4]!= ARRAY [2,3,4,5]

  
Array_Elements  

Specifies the elements in the array. You must include the square brackets when you specify the array elements.

Note: It is legal to have an empty array. For example:

SELECT foo FROM SCOPE() WHERE bar = ARRAY[]

Examples

  1. The following example finds all the compressed files with the archive bit set to ON.

    ...WHERE attrib = ARRAY [ 0X820 ]
  2. The following example finds the files with the archive bit set to ON or the compressed bit set to ON.

    ...WHERE attrib = SOME ARRAY [0X820 ]
  3. The following example finds ActiveX documents with a vectorprop value of [10,15,20].

    ...WHERE vectorprop = ARRAY [10, 15, 20]
  4. The following example finds ActiveX documents where at least one vectorprop value is 15.

    ...WHERE vectorprop = SOME ARRAY [15]
  5. The following example finds files that must be printed by printers named HP3 or HP4.

    ...WHERE printerprop = SOME ARRAY [ 'HP4' , 'HP3' ]

© 1997 by Microsoft Corporation. All rights reserved.


file: /Techref/language/asp/ix/ixseary.htm, 6KB, , updated: 1997/9/29 03:23, local time: 2024/8/15 23:22,
TOP NEW HELP FIND: 
3.141.25.212:LOG IN

 ©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?
Please DO link to this page! Digg it! / MAKE!

<A HREF="http://techref.massmind.org/techref/language/asp/ix/ixseary.htm"> SQL Access to Index Server Data: ARRAY Predicate</A>

After you find an appropriate page, you are invited to your to this massmind site! (posts will be visible only to you before review) Just type a nice message (short messages are blocked as spam) in the box and press the Post button. (HTML welcomed, but not the <A tag: Instead, use the link box to link to another page. A tutorial is available Members can login to post directly, become page editors, and be credited for their posts.


Link? Put it here: 
if you want a response, please enter your email address: 
Attn spammers: All posts are reviewed before being made visible to anyone other than the poster.
Did you find what you needed?

 

Welcome to massmind.org!

 

Welcome to techref.massmind.org!

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  .