Showing posts with label where clause. Show all posts
Showing posts with label where clause. Show all posts

Friday, August 28, 2015

SQL -- conditional selections

In the last example the condition was first should equal 'Eric'. Besides equal here are other conditional clauses used in SQL:



= Equal
> Greater than
< Less than
>= Greater than or equal
<= Less than or equal
<> Not equal to
LIKE pattern matching operator, use "%" as character wild card

Here is an example:



select first,
       last,
       city
  from empinfo
where city <>
  'Payson';



Tuesday, August 25, 2015

SQL -- Selecting Data



select *
                from empinfo
                where first = 'Eric'

The above examples SQL query selects all (*) columns from the empinfo table where the first name is Eric. See result of the query below.