pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rv02 <v.razaghzadeh@gmail.com>
To: pgsql-general@postgresql.org
Subject: Check to see if customer exist in second table. Help needs with psql
Date: Sun, 17 Jun 2018 12:19:31 -0700 (MST)
Message-ID: <1529263171492-0.post@n3.nabble.com> (raw)



psql
I have two tables , table A and Table b. Table A has list of about 60000
customers ID with all their details and Table B had customer is and age for
over 500000 rows of customers.

I need a query that will take a customer from table a and if that customer
exists in table B then insert a yes in a new column in table a. Basically
what I want to end up with in table a , is all the customers in this table
and if they exist in table B then yes in a column. I.e the final result will
be 60000 customers and additional column at the end with yes or no depending
if they exist in table B.

Any help is appreciate it



--
Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html




view thread (2+ messages)  latest in thread

Message-ID: <1529263171492-0.post@n3.nabble.com>
Permalink:  ../1529263171492-0.post@n3.nabble.com/
Also on:    postgresql.org/message-id/1529263171492-0.post@n3.nabble.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: v.razaghzadeh@gmail.com
  Subject: Re: Check to see if customer exist in second table. Help needs with psql
  In-Reply-To: <1529263171492-0.post@n3.nabble.com>
  References: <1529263171492-0.post@n3.nabble.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox