Ask a Question related to Coldfusion Database Access, Design and Development.
-
kabbi~thkek #1
advanced delete query sql
Hi,
I have two tables:
dev table:
dev_id volgnr type
1 B-05-1001 1(pc)
2 B-05-3001 3(mon)
3 B-05-3002 3(mon)
4 B-05-3003
kop table:
tabelid kop_pc kop_mon
1 1 2
2 1 3
3 1 4
I have a dev table which stands for all the device with there dev_id (primary
key and auto increment) there number (volgnr) and the type (1=pc and 3=monitor).
I also have a kop table to be able to attach monitors to computers. As you can
see monitor 2,3, and 4 are all attached to computer 1. (kop_mon is the dev_id
of table dev an kop_pc is the dev_id of table dev).
With the following query it is possible to select the computers number
(volgnr) and the numbers (volgnr) of the attached monitors:
select c.dev_volgnr as comp_nr
, m.dev_volgnr as mon_name
from dev as c
inner
join kop
on kop.kop_pc
= c.dev_id
inner
join dev as m
on m.dev_id = kop.kop_mon
where c.dev_id = #URL.dev_id#
(thanks for the code!)
However What I now want to do is make a query so I can delete one monitor from
the kop table without deleting the monitor from the dev table.
I made a page where I query the dev table to show the results for dev_id 1
(the computer). The attached devices are shown into a formfield.
With if / ifelse I select the right formfield and want to delete a monitor
(kop_mon 4) from the kop table (I suppose by using the number (volgnr
B-05-3003) in any way which is showing in the formfield (FORM.number_fld1)....
Could somebody explain me how I could do this? How would the query look like?
Thank you in advance.
Gr, Kabbi
kabbi~thkek Guest
-
Where to find: Advanced Query Wizard
you can find a link to the Advanced Query Wizard on the Adobe Exchange, but under the given link there is no more any software to find. Does anyone... -
Need Help with Advanced SQL Query
It's advanced for me, at least. I have three tables that I need to use: Product (product_id and product_title are the fields) shipRegion... -
Help with delete query please
Hi Having problem with delete query. Below is query: $unconfirmedstatus = 'Unconfirmed'; $firstquery = "DELETE FROM Pendingsales WHERE time <... -
Delete row in query
Hello, I hope you'll be able to help me with this simple question. There is a query created dinamically with QueryNew(), and then moved to a... -
variable empty after after posting a delete query
The variable contains: delete from divisies where divisieid='1c' After posting it contains: delete from divisies where divisieid= So the part... -
kabbi~thkek #2
Re: delete items query sql
Hello,
Nobody has an Idea how I could do this?
Gr, Kabbi
kabbi~thkek Guest



Reply With Quote

