Monday, 15 June 2015

sql - Not Understanding Where Statement -


I'm new to SQL, I'm looking at some code for a small database for a medical office. What does the following mean and what will happen ... Patient, I get an area in DB. This code is repeated for each code.

  Where (less ("patient") ('%' || lower (patient) '%')    

This is an insensitive case in search of rows where "patient" in column : Patient parameter The substrings passed in.

Lower converts both parties to lower case.

ANSI is a SQL string converter operator .

% in a like pattern is a wildcard meaning "zero Match any set or more characters ".

So if : patient was Smith works as expression

  where '% smith%' like lower ("patient")    

No comments:

Post a Comment