ratinakage
Programmer
Hi there,
I am wanting to run an insert that uses two values form two select statements.
I think it should be clear what I'm trying to do. Basically get the two contact IDs for the first two values (and 4 for the relationship_type_id and 1 for is_active).
The error I get is: Every derived table must have its own alias
Any help would be much appreciated!
Thanks...
I am wanting to run an insert that uses two values form two select statements.
I think it should be clear what I'm trying to do. Basically get the two contact IDs for the first two values (and 4 for the relationship_type_id and 1 for is_active).
Code:
INSERT INTO civicrm_relationship
(contact_id_a, contact_id_b, relationship_type_id, is_active)
(SELECT AA,
BB,
4,1
FROM
(SELECT id AA FROM civicrm_contact WHERE external_identifier = 283),
(SELECT id BB FROM civicrm_contact WHERE external_identifier = 274))
Any help would be much appreciated!
Thanks...