On Wed, Mar 16, 2016 at 9:34 PM, drum.lu...@gmail.com
wrote:
> The problem is that I need to do that at the same time, because of a
> constraint:
>
>
Mark your constraint as deferrable, and then defer the constraints within
your transaction.
> "drum.lu...@gmail.com" hat am 17. März 2016 um 02:34
> geschrieben:
>
>
> I'm trying to insert data from TABLE A to TABLE B.
>
> 1 - Select billable_id from dm.billable
> 2 - Select mobiuser_id from ja_mobiusers
> 3 - Insert the billable_id and the mobiuser_id to the dm.billables_links
> ta
>
>
> assuming those two queries 1 and 2 return multiple rows, which rows of
> junk.wm_260_billables2 match up with what rows of public.ja_mobiusers ?
>
> your schema is very poorly defined. I think you need to take a class in
> relational database design and usage, or read a good book on
> >
> Hi Andreas!
>
> Well...
>
> There are two tables that I need to get data from(dm.billables /
> public.ja_mobiusers), and a third table (dm.billables_links) that I need to
> insert data from those two tables.
lets start from here. you have 2 tables:
test=*# select * from source1;
i
---
On Wed, Mar 16, 2016 at 6:49 PM, Andreas Kretschmer wrote:
>
>
> > "drum.lu...@gmail.com" hat am 17. März 2016 um
> 02:34
> > geschrieben:
> >
> >
> > I'm trying to insert data from TABLE A to TABLE B.
> >
> > 1 - Select billable_id from dm.billable
> > 2 - Select mobiuser_id from ja_mobiusers
>
>
>
>
> I see a lot of other problems: you have 3 independet tables. Your 2 queries
> (selects) returns 2 independet results, you can't use that for insert into
> the
> 3rd table. And i think, you are looking for an update, not insert. So you
> have
> to define how your tables are linked together (
On 18 March 2016 at 03:23, Adrian Klaver wrote:
> On 03/16/2016 07:07 PM, drum.lu...@gmail.com wrote:
>
>>
>>
>>
>>
>> I see a lot of other problems: you have 3 independet tables. Your 2
>> queries
>> (selects) returns 2 independet results, you can't use that for
>> insert into th
On 3/16/2016 7:07 PM, drum.lu...@gmail.com wrote:
*1 -* select the billable_id: (SELECT1)
SELECT billable_id FROM junk.wm_260_billables2 WHERE info ilike '%Alisha%'
*2 -* select the mobiuser_id: (SELECT2)
SELECT id FROM public.ja_mobiusers WHERE name_first LIKE 'Alisha%' AND
name_last LIKE 'Da
I'm trying to insert data from TABLE A to TABLE B.
1 - Select billable_id from dm.billable
2 - Select mobiuser_id from ja_mobiusers
3 - Insert the billable_id and the mobiuser_id to the dm.billables_links
table.
*FYI -* It has to be in the same transaction because the mobiuser_id must
go to the
On 03/16/2016 07:07 PM, drum.lu...@gmail.com wrote:
I see a lot of other problems: you have 3 independet tables. Your 2
queries
(selects) returns 2 independet results, you can't use that for
insert into the
3rd table. And i think, you are looking for an update, not insert.
10 matches
Mail list logo