Amanda Walshaw
asked on
sql 2008 view
I have created the following view
create view [dbo].[myview_vw]
AS
SELECT a.vendor_code,
a.address_name,
a.contact_phone,
a.fax_number,
a.attention_email,
a.terms_code,
b.bank_name,
b.bank_account_num,
b.aba_number,
b.account_type
FROM mymaserap a, mybankdet b
where a .vendor_code = b.vendor_code
GO
this works fine but what I want to say is what is a Savings Account and what is A cheque account based on b. account_type
alter view [dbo].[myview_vw]
AS
SELECT a.vendor_code,
a.address_name,
a.contact_phone,
a.fax_number,
a.attention_email,
a.terms_code,
b.bank_name,
b.bank_account_num,
b.aba_number,
b.account_type = case b.account_type
when 0 then 'Savings Account'
when 1 then 'Cheque Account'
end
FROM mymaserap a, mybankdet b
where a .vendor_code = b.vendor_code
GO
I am getting syntax error near '='
I should be able to put in a case here.
Would welcome some advice
create view [dbo].[myview_vw]
AS
SELECT a.vendor_code,
a.address_name,
a.contact_phone,
a.fax_number,
a.attention_email,
a.terms_code,
b.bank_name,
b.bank_account_num,
b.aba_number,
b.account_type
FROM mymaserap a, mybankdet b
where a .vendor_code = b.vendor_code
GO
this works fine but what I want to say is what is a Savings Account and what is A cheque account based on b. account_type
alter view [dbo].[myview_vw]
AS
SELECT a.vendor_code,
a.address_name,
a.contact_phone,
a.fax_number,
a.attention_email,
a.terms_code,
b.bank_name,
b.bank_account_num,
b.aba_number,
b.account_type = case b.account_type
when 0 then 'Savings Account'
when 1 then 'Cheque Account'
end
FROM mymaserap a, mybankdet b
where a .vendor_code = b.vendor_code
GO
I am getting syntax error near '='
I should be able to put in a case here.
Would welcome some advice
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER