Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"Easy" SQL query

Status
Not open for further replies.

INTLuis

Programmer
Oct 9, 2002
2
0
0
ES
Hello,

I've created the query:

SELECT "Clients"."Out" FROM "Clients" LEFT OUTER JOIN "Clients interested" ON "Clients"."Id" = "Clients interested"."Id" WHERE "Clients interested"."Out" = 0

It works perfectly. (803 registers)

BUT, now I want to update the obtained recordset (803 registers with the "Clients"."Out" field) to:

UPDATE [Recordset] SET [Field "Clients"."Out"] = 0

How could I build the complete query in ONLY ONE, joining the keywords SELECT and UPDATE?

JUST ONE QUERY!

Thank you very much!

 
See RULE information:
And search more about rules here:
Rules in PostgreSQL are similar to triggers, but are ONLY special queries which are defined to do additional action to any query on a table.

In this case you would want an ON SELECT rule to perform your additional update.

Rules can also be applied to views. In fact, this is the mechanism by which views can be made updateable in PostgreSQL.

-------------------------------------------

My PostgreSQL FAQ --
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top