Re: Populate Table From Two Other Tables

From: Darren Duncan <darren(at)darrenduncan(dot)net>
To: Rich Shepard <rshepard(at)appl-ecosys(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Populate Table From Two Other Tables
Date: 2012-06-06 05:19:51
Message-ID: 4FCEE877.9020308@darrenduncan.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Rich Shepard wrote:
> I'm surprised: that worked! I thought the WHERE clause was looking for
> equivalency, not an assignment.

SQL generally uses "=" to mean equality test, but sometimes it also uses "=" to
mean assignment; it depends on the context; eg, in an UPDATE statement it can
have both meanings:

update mytbl
set foo = 3
where bar = 5;

Though procedural SQL also uses ":=" to mean assignment.

Thinking that "=" could only ever mean assignment is rather short-sighted; while
many programming languages do that, many more don't.

-- Darren Duncan

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Mike Christensen 2012-06-06 05:50:16 Re: I'd like to learn a bit more about how indexes work
Previous Message Ben Carbery 2012-06-06 05:07:02 Partitioning Advice