I don’t really know if I worded it correctly, but I’ll try to explain what I want.
Table 1 - X
id | name | blah
Table 2 - Y
id | Xid | configKey | ConfigVal
What I want to do is, create a row in table 2 for everything in table 1, where the corresponding id from Table 1 goes into the column Xid in table 2. I’m from a java background and not too keen on sql, so not too sure how to do this. There are a lot of rows in table 1, which is why I would like to script it out.
I pretty much want to do something like this:
Table1 (the object table)
1 test1 a
2 test3 b
3 testn n
Run the query to get populate this
Table 2 (the config table)
...exisitng rows
59 1 doSomething true
60 2 doSomething true
61 3 doSomething true
So, I pretty much want to add in a config row (all the same values) except for the id it corresponds to (column 2 in table 2 should be col 1 from table 1)
Thanks
To use fixed values ‘doSomething’ and ‘true’ for all inserted records: