pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feeddelete rows
2+ messages / 2 participants
[nested] [flat]
* delete rows
@ 2000-11-30 01:01 Astrid Hexsel <ahexse01@postoffice.csu.edu.au>
2000-11-30 02:47 ` Re: delete rows Stephan Szabo <sszabo@megazone23.bigpanda.com>
0 siblings, 1 reply; 2+ messages in thread
From: Astrid Hexsel @ 2000-11-30 01:01 UTC (permalink / raw)
To: pgsql-sql
Hello All,
After trying for two weeks to delete more than one row at the time from a form
- checkbox input, I was told that the only way different rows would be inputed
or changed with the information from the form would be with the INSERT command.
This way the best alternative I could think of, would be
to still have my table cart:
For eaxmple:
session_id|range_id|colour_id|
------------------------------
122 | 4004-4 | 4002
122 | 4004-4 | 4003
122 | 4004-4 | 4004
which contains all the items added to the cart.
Then when a deletion is required, the information from the form would be inserted
into "cartchange table":
For example:
session_id| colour_id|condition|
---------------------------------
122 | 4001 | yes
122 | 4002 | yes
Now what I am trying to do is to delete the rows
from cart that appear in the cartchange table.
I have tried to join the tables , but I could not find the right query to delete
similar rows.
Am I missing something here ?
Any help will be extremely appreciated. :)
Astrid
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: delete rows
2000-11-30 01:01 delete rows Astrid Hexsel <ahexse01@postoffice.csu.edu.au>
@ 2000-11-30 02:47 ` Stephan Szabo <sszabo@megazone23.bigpanda.com>
0 siblings, 0 replies; 2+ messages in thread
From: Stephan Szabo @ 2000-11-30 02:47 UTC (permalink / raw)
To: Astrid Hexsel <ahexse01@postoffice.csu.edu.au>; +Cc: pgsql-sql
On Thu, 30 Nov 2000, Astrid Hexsel wrote:
> After trying for two weeks to delete more than one row at the time from a form
> - checkbox input, I was told that the only way different rows would be inputed
> or changed with the information from the form would be with the INSERT command.
>
>
> This way the best alternative I could think of, would be
> to still have my table cart:
> For eaxmple:
>
> session_id|range_id|colour_id|
> ------------------------------
> 122 | 4004-4 | 4002
> 122 | 4004-4 | 4003
> 122 | 4004-4 | 4004
>
> which contains all the items added to the cart.
>
> Then when a deletion is required, the information from the form would be inserted
> into "cartchange table":
> For example:
>
> session_id| colour_id|condition|
> ---------------------------------
> 122 | 4001 | yes
> 122 | 4002 | yes
>
>
> Now what I am trying to do is to delete the rows
> from cart that appear in the cartchange table.
>
> I have tried to join the tables , but I could not find the right query to delete
> similar rows.
Would a subselect work here? something like...
delete from cart where exists (select * from cartchange where
cartchange.session_id=cart.session_id and
cartchange.colour_id=cart.colourid);
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2000-11-30 02:47 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2000-11-30 01:01 delete rows Astrid Hexsel <ahexse01@postoffice.csu.edu.au>
2000-11-30 02:47 ` Stephan Szabo <sszabo@megazone23.bigpanda.com>
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