Create view in PSQL 9
Create view in PSQL 9
(OP)
Good morning. I'm very new to PSQL and need to create a view. Is it possible to take a value, have that value in a view and take the first 5 char's and put that in another field and the second 5 chars and put that in another field. My result should be like:
Item Main Sub
123456789123456 12345 67891
I want to be able to link this view to an "Item" table in a CR9 report and select the Main or Sub values, so the user will only have to select the Main or Sub values for a parameter.
Any help is appreciated.
Gene
Item Main Sub
123456789123456 12345 67891
I want to be able to link this view to an "Item" table in a CR9 report and select the Main or Sub values, so the user will only have to select the Main or Sub values for a parameter.
Any help is appreciated.
Gene
RE: Create view in PSQL 9
create table viewtest ( f1 char(16))
insert into viewtest values ('123456789123456')
select f1, left(f1,5), substring(f1,6,5) from viewtest
So to answer the question, you need to use the LEFT and SUBSTRING to get the values you want. You don't need a view specifically.
Mirtheil
Certified Pervasive Developer
Certified Pervasive Technician
http://www.mirtheil.com
RE: Create view in PSQL 9