Quantcast
Channel: Forum Getting started with SQL Server
Viewing all articles
Browse latest Browse all 7129

SQL QUERY

$
0
0

Hi Friends,

I have one scenario in banking domain project....... one customer can have multiple accounts in a bank as shown below.

so how to write a query to get all customers no's where the corresponding all accounts status is 'Y'

so for the below scenario i need to show customers(1001,1003) as output

customer id account no. account status
100112345 y
100198768 y
10012564987 y
100212335 n
100254557 y
1002787887 y
1003224234 y
100454654 y
100445614 n

Thanks in advance.....................


Viewing all articles
Browse latest Browse all 7129

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>