Insert with subquery and select

19 views
Skip to first unread message

j.barrett Strausser

unread,
Aug 27, 2015, 11:49:37 AM8/27/15
to Slick / ScalaQuery
Is it feasible to do an insert with a subquery such as the following simplified example.

I have only done inserts that span two tables by using the filter(row => row.someField inSet(...)) hack. I'm not sure how to approach this.

INSERT INTO
foo
(shard_id,key,expiry)
VALUES
(
   SELECT
     shard_id, key, expiry
   FROM
    shard_meta_data
  WHERE
    shard_meta_data = 'some_shard_host'
)

Thanks in advance

-b


 
Reply all
Reply to author
Forward
0 new messages