Quantcast
Channel: dBforums – Everything on Databases, Design, Developers and Administrators
Viewing all articles
Browse latest Browse all 13329

Decode SQL..multiple tables.

$
0
0
I have a simple decode that works as shown below;

SELECT membership_type,
DECODE(membership_type, 'Gold', 'First',
'Silver', 'Second',
'Bronze', 'Third',
'Gateway') Result
FROM m_membership_type


What I am trying to do is simply output some columns from another table as well, so I want to output customer_id from my m_customer table, below is what I figured the code is;

SELECT membership_type, customer_id
DECODE(membership_type, 'Gold', 'First',
'Silver', 'Second',
'Bronze', 'Third',
'Gateway') Result
FROM m_membership_type, m_customer

But I get the: ORA-00923: FROM keyword not found where expected error?

Viewing all articles
Browse latest Browse all 13329

Trending Articles