Wednesday 15 September 2010

sql - How can i select an element from a Varray with the like Keyword -


Please help me to select a phone array in the SQL statement where the phone is an array

< P> Type vararchar2 (13) as varray (3);

Select the name, match the person, where (type) of value (P) and (phone starts with '0770');

Take a look at this sample:

  type phone_v As varray (3) varchar2 (13); - Create type creation table person (name varchar2 (100), phone phone_v); - Eligible creation - Insert qualified data in person values ​​('John', Phone_V ('0770 12', '0789 00', '0101')); Enter the person values ​​('David', phone_v ('1', '1', '1'));  

Now you can do something like: Choose

  to select from * to the person from where to (choose one per table) where the column_view '% 0770% ');  

This query receives data from all those who have a phone number with 0770 , if you want the phone to start with this number So just this kind of expression is 0770%


No comments:

Post a Comment