IRSA Catalog Search Service
Documentation for Web Interface
Additional Constraints (SQL)
Overview
IRSA's Catalog Search Service allows potentially complex constraints to be specified in SQL format in the "Additional Constraints" section of the Query building interface. These include the following classes of constraints:
Keywords and Operators
keyword/operator | description | syntax | example using AllWISE Source Catalog 1000 arcsecond cone search centered on M81 |
---|---|---|---|
= | Compares two expressions. The result is TRUE if both operands are equal. Otherwise, the result is FALSE. |
expression = expression | designation = 'J095824.30+685729.3' |
!= | Compares two expressions. The result is TRUE if the left operand is not equal to the right operand. Otherwise, the result is FALSE. |
expression != expression | designation != 'J095824.30+685729.3' |
< | Compares two expressions. When comparing numeric values, the result is TRUE if the left operand has a lower value than the right operand. When comparing character values, the results is TRUE if the left operand is earlier in the alphabet than the right operand. When comparing dates, the results is TRUE if the left operand is earlier than the right operand. Otherwise, the result is FALSE. |
expression < expression | w1mpro < 16 designation < 'J095824.30+685729.3' |
<= | Compares two expressions. When comparing numeric values, the result is TRUE if the left operand is less than or equal to the right operand. When comparing character values, the results is TRUE if the left operand is earlier in the alphabet or equal to the right operand. When comparing dates, the results is TRUE if the left operand is earlier or equal to the right operand. Otherwise, the result is FALSE. |
expression <= expression | w1mpro<=16 designation<='J095824.30+685729.3' |
> | Compares two expressions. When comparing numeric values, the result is TRUE if the left operand is greater than the right operand. When comparing character values, the results is TRUE if the left operand is later in the alphabet than the right operand. When comparing dates, the results is TRUE if the left operand is later than the right operand. Otherwise, the result is FALSE. |
expression > expression | w1mpro>16 designation>'J095824.30+685729.3' |
>= | Compares two expressions. When comparing numeric values, the result is TRUE if the left operand is greater than or equal to the right operand. When comparing character values, the results is TRUE if the left operand is later in the alphabet or equal to the right operand. When comparing dates, the results is TRUE if the left operand is later than or equal to the right operand. Otherwise, the result is FALSE. |
expression >= expression | w1mpro>=16 designation>='J095824.30+685729.3' |
NOT | Used to negate an operation. | NOT expression |
w2sigmpro IS NOT NULL dec NOT BETWEEN 69 AND 69.1 |
BETWEEN | Specifies a range to test. BETWEEN returns TRUE if the value of test_expression is greater than or equal to the value of begin_expression and less than or equal to the value of end_expression. |
test_expression [ NOT ] BETWEEN begin_expression AND end_expression | ra BETWEEN 148.6 AND 149.2 dec NOT BETWEEN 69 AND 69.1 |
IN | Determines if a given value matches any value in a subquery or a list. | test_expression [ NOT ] IN ('expression', 'expression', ... , 'expression') | ph_qual IN ('ABUU', 'BUUU', 'BCCU') |
LIKE | Determines whether a character string matches a specified pattern. A pattern can include regular characters and wildcard characters. During pattern matching, regular characters must exactly match the characters specified in the character string. Wildcard characters, however, can be matched with arbitrary fragments of the character string. IRSA's Catalog Search Service accepts two wildcards: % (percent; matches any string of >0 characters) _ (underscore; matches any single character) If you would like to include percent or underscore in your pattern, but do not wish them to be interepreted as wildcards, then you may specify an escape character using "ESCAPE escape_parameter". |
match_expression [ NOT ] LIKE pattern |
designation LIKE 'J0958%' - selects any designation that starts with 'J0958%' designation LIKE '%0958%' - selects any designation with '0958' in it. ph_qual LIKE 'AAA_' - selects any ph_qual with four letters, the first three of which are 'AAA'. |
IS [NOT] NULL | An entry of NULL in a data table means that there is no entry (e.g., missing data). NULL is not synonymous with 'zero' or 'blank'. 'NULL' and 'null' are equivalent. If the value of expression is NULL, IS NULL returns TRUE; otherwise, it returns FALSE. If the value of expression is NULL, IS NOT NULL returns FALSE; otherwise, it returns TRUE. |
expression IS [ NOT ] NULL | w2sigmpro IS NOT NULL w2sigmpro IS NULL |
AND | Combines two expressions and returns TRUE when both expressions are TRUE. When more than one logical operator is used in a statement, AND operators are evaluated first. You can change the order of evaluation by using parentheses. | expression AND expression | (w2sigmpro IS NOT NULL) AND (ra BETWEEN 148.6 AND 149.2) |
OR | Combines two conditions. When more than one logical operator is used in a statement, OR operators are evaluated after AND operators. However, you can change the order of evaluation by using parentheses. | expression OR expression | (ra BETWEEN 148.6 AND 149.2) OR (dec NOT BETWEEN 69 AND 69.1) |
+ | plus | expression + expression | |
- | minus | expression - expression | |
/ | divided by | expression / expression | |
* | multiply | expession * expression | |
% | modulo, the remainder left after division of two numbers. | expression % expression | |
ABS | Absolute Value | abs(expression) | |
ACOS | Arc Cosine | acos(expression) | |
ASIN | Arc Sine | asin(expression) | |
ATAN | Arc Tangent | atan(expression) | |
COS | Cosine | cos(expression) | |
EXP | Returns the exponential value in scientific notation of the argument | exp(expression) | EXP(198.1938327) = 1.18710159597953E+86 |
FLOOR | Returns the largest integer equal to or less than the specified argument. | floor(expression) | floor(15.7) = 15. |
LOG | Logarithm (base 10) | log(10, expression) | |
POWER | numeric_expr raised to the power of p | power(expression, p) | |
RAND | Produce a random float number between 0 and 1. When invoked with the optional integer argument, that value will be used to seed the random number generator. For a specified seed value, the result returned is always the same. | rand([integer_expression]) | rand() rand(10) |
ROUND | Returns the rounded value of the first expression, out to integer_expression digits | round(expression, integer_expression) | ROUND(123.9994, 3)=123.999 ROUND(123.9995, 3)=124.0000 ROUND(150.75, 0)=151.00 |
SIN | Returns the trigonometric sine of the specified angle, in radians. | sin(expression) | |
SQRT | Returns the square root of the specified float. | sqrt(expression) | |
TAN | Returns the trigonometric tangent of the specified angle, in radians. | tan(expression) |