Quantcast
Channel: Microsoft SQL Server
Viewing all articles
Browse latest Browse all 4871

SQL Joins

$
0
0

Hi,

I'm trying to join 2 SQL tables to achieve what I need and am struggling a little. I'll try and explain below.

table client_address contains contact information for our clients. I am interested in extracting the contents of clientemail and clientemail2 fields from this table.

I only want to extract this information for our "current" clients. I.e. those that we presently do business with. This information is included within table client_policies. The problem here is that client.policies could contain multiple rows of data if the client has more than 1 policy in force with us (we are a financial services company).

The common field between the 2 tables is clientref so client_address.clientref and client_policies.clientref.

When I join the tables and try to extract the clientemail and clientemail2 data, I get this replicated if the client...


Viewing all articles
Browse latest Browse all 4871

Trending Articles



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