Home > Blockchain >  select * from conversation where in [array]
select * from conversation where in [array]

Time:10-22

here is my sql statement(sqlite3):

select * from conversation where (conversationId, conversationType) in (values(5736, 'public'), (5817, 'private'))

i try to(typeorm):

.where(`(conversationId, conversationType) IN (values:...params)`, {params: params})

but it turns error: QueryFailedError: SQLITE_ERROR: near "?": syntax error.
query: 'DELETE FROM "conversation" WHERE ("conversationId", "conversationType") IN (values?, ?)',
parameters: [ [ 5736, 'private' ], [ 5817, 'private' ] ].
anybody help?

CodePudding user response:

I don't know typeorm, but maybe this can help you:

SELECT * 
FROM conversation 
WHERE conversationId || '-' || conversationType IN ('5736-public', '5817-private')

DELETE 
FROM conversation 
WHERE conversationId || '-' || conversationType IN ('5736-public', '5817-private')
  • Related