# WHERE Clause

Copyright (c) 2008, 2020 SAP AG and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html

The WHERE clause specifies search conditions, that remove unwanted data from the query result. The following operators, are in order of precedence. The operators are evaluated in the specified order:

# >=, <=, >, <, [ NOT ] LIKE, [ NOT ] IN, IMPLEMENTS (relational operations)

SELECT * FROM java.lang.String s WHERE s.count >= 100
SELECT * FROM java.lang.String s WHERE toString(s) LIKE ".*day"
SELECT * FROM java.lang.String s WHERE s.value NOT IN dominators(s)
SELECT * FROM java.lang.Class c WHERE c IMPLEMENTS org.eclipse.mat.snapshot.model.IClass

# =, != (equality operations)

SELECT * FROM java.lang.String s WHERE toString(s) = "monday"

# AND (conditional AND operation)

SELECT * FROM java.lang.String s WHERE s.count > 100 AND s.@retainedHeapSize > s.@usedHeapSize

# OR (conditional OR operation)

SELECT * FROM java.lang.String s WHERE s.count > 1000 OR s.value.@length > 1000

Operators can be applied to expressions, constant literals and sub queries. Valid expressions are explained in the next sections.

# Literal Expression

Boolean, String, Integer, Long, Character and null literals:

SELECT * FROM java.lang.String s WHERE ( s.count > 1000 ) = true WHERE toString(s) = "monday" WHERE dominators(s).size() = 0 WHERE s.@retainedHeapSize > 1024L WHERE s.value != null AND s.value.@valueArray.@length >= 1 AND s.value.@valueArray.get(0) = 'j' WHERE s.@GCRootInfo != null