Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CREATE A VIEW 1

Status
Not open for further replies.

cristi22

MIS
Aug 17, 2005
155
US
Hello all!

Really appreciate your help!

1) How do check if the length of the ALPHA is 1
2) How do I create a view based on the following conditions?

Code:
select count(member_key) from member where
length(ALPHA) = 1 ????? 
and  (ADDRESS_2 is null OR ADDRESS_2 = '' ) and
(ADDRESS_3 is null   OR ADDRESS_3 = '' ) and
(ADDRESS_1 is null  or  ADDRESS_1 = '' ) and
(COUNTRY_CODE is null  OR COUNTRY_CODE = '' ) and
(ZIP_CODE is null  OR ZIP_CODE = '' )
 
1) length(ALPHA) = 1 should work. What problem are you having with it?

2)
Code:
create view myview as
  select count(member_key) from member where
  length(ALPHA) = 1  
  and  (ADDRESS_2 is null OR ADDRESS_2 = '' ) and
  (ADDRESS_3 is null   OR ADDRESS_3 = '' ) and
  (ADDRESS_1 is null  or  ADDRESS_1 = '' ) and
  (COUNTRY_CODE is null  OR COUNTRY_CODE = '' ) and
  (ZIP_CODE is null  OR ZIP_CODE = '' )
 
it worked:
Code:
create view  _view as 
select *  from member where
length(ALPHA) = 1 and
(ADDRESS_2 is null OR ADDRESS_2 = '' ) and
(ADDRESS_3 is null   OR ADDRESS_3 = '' ) and
(ADDRESS_1 is null  or  ADDRESS_1 = '' ) and
(COUNTRY_CODE is null  OR COUNTRY_CODE = '' ) and
(ZIP_CODE is null  OR ZIP_CODE = '' )
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top