Comparing where sub-clauses between different SQL statements is important in analyzing SQL statements, which is usually the key for databases security. Comparing them literally is not sufficient, because there may be different character strings for the same semantic structure. A method called Logical Tree (LT) is proposed in this paper, which is used to compare different where sub-clauses semantically. By this method, where sub-clauses of SQL statements are denoted by trees. Some basic definitions of LT are addressed. According to laws of logical expressions, which are the form of where sub-clauses, accordingly laws and operations are defined for Logical Tree (LT).