Search for String Across Columns : Select clause « Query Select « Oracle PL/SQL Tutorial






SQL>
SQL> CREATE TABLE myRoom
  2  (name   VARCHAR(10)
  3  ,floorcolor VARCHAR(10)
  4  ,ceilingcolor VARCHAR(10)
  5  ,wallcolor VARCHAR(10)
  6  );

Table created.

SQL> INSERT INTO myRoom VALUES ('Jim','RED','GREEN','YELLOW');

1 row created.

SQL> INSERT INTO myRoom VALUES ('Bob','YELLOW','BLUE','BLACK');

1 row created.

SQL> INSERT INTO myRoom VALUES ('Allan','BLUE','PINK','BLACK');

1 row created.

SQL> INSERT INTO myRoom VALUES ('George','BLUE','GREEN','OAK');

1 row created.

SQL>
SQL> SELECT name FROM myRoom
  2  WHERE floorcolor = 'YELLOW'
  3  OR    ceilingcolor = 'YELLOW'
  4  OR    wallcolor = 'YELLOW';

NAME
----------
Jim
Bob

SQL>
SQL> DROP TABLE myRoom;

Table dropped.

SQL>








2.2.Select clause
2.2.1.Performing Single Table SELECT Statements
2.2.2.Select employee first and last and sort by last name
2.2.3.List single column from a table
2.2.4.Use as to specify the alias name
2.2.5.Use function in select clause
2.2.6.Use more than one aggregate functions in a select statement
2.2.7.where clause
2.2.8.Compare with number
2.2.9.Concatenate string
2.2.10.Select from a Subquery
2.2.11.Select constant as a column
2.2.12.Negate a column value
2.2.13.Math calculation in select statement
2.2.14.Search for String Across Columns
2.2.15.Don't Perform the Same Calculation Over and Over
2.2.16.NO_INDEX function in select statement