Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 61DF9200B5A for ; Thu, 4 Aug 2016 09:03:10 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 49467160AAB; Thu, 4 Aug 2016 07:03:10 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 91965160A7C for ; Thu, 4 Aug 2016 09:03:09 +0200 (CEST) Received: (qmail 7429 invoked by uid 500); 4 Aug 2016 07:03:08 -0000 Mailing-List: contact user-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@ignite.apache.org Delivered-To: mailing list user@ignite.apache.org Received: (qmail 7419 invoked by uid 99); 4 Aug 2016 07:03:08 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Aug 2016 07:03:08 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 4742BC0BB4 for ; Thu, 4 Aug 2016 07:03:08 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.173 X-Spam-Level: ** X-Spam-Status: No, score=2.173 tagged_above=-999 required=6.31 tests=[DKIM_ADSP_CUSTOM_MED=0.001, NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_NONE=-0.0001, SPF_SOFTFAIL=0.972] autolearn=disabled Received: from mx2-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id H8v7yVhuILqk for ; Thu, 4 Aug 2016 07:03:06 +0000 (UTC) Received: from mbob.nabble.com (mbob.nabble.com [162.253.133.15]) by mx2-lw-us.apache.org (ASF Mail Server at mx2-lw-us.apache.org) with ESMTP id 13E436126D for ; Thu, 4 Aug 2016 07:03:01 +0000 (UTC) Received: from malf.nabble.com (unknown [162.253.133.59]) by mbob.nabble.com (Postfix) with ESMTP id 68F752E03C22 for ; Wed, 3 Aug 2016 23:37:56 -0700 (PDT) Date: Thu, 4 Aug 2016 00:02:58 -0700 (PDT) From: begineer To: user@ignite.apache.org Message-ID: <1470294178110-6732.post@n6.nabble.com> In-Reply-To: <1470271662076-6723.post@n6.nabble.com> References: <1470161779255-6674.post@n6.nabble.com> <1470172308243-6680.post@n6.nabble.com> <1470208182505-6697.post@n6.nabble.com> <1470212234345-6702.post@n6.nabble.com> <1470271662076-6723.post@n6.nabble.com> Subject: Re: Getting exception in SQL Query JOINS MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit archived-at: Thu, 04 Aug 2016 07:03:10 -0000 So What I mean is I need to get data from cache which has keys in the list I pass to query. equavalent SQL will be like, List list = Arrays.asList(2,3,6);//dynamic list coming from client StringBuffer queryStrings = new StringBuffer(" "); for (Object object : list) { queryStrings.append("?,"); } queryStrings.deleteCharAt(queryStrings.length()-1); String sql = "select * from Company where Id in (?); SqlQuery query1 = new SqlQuery<>(Company.class, sql); query1.setArgs(queryStrings.toString()); Here, I can append as many keys to stringbuffer as I want and then pass them to IN clause. BUt this is not good approach and plus IN will not use indexing. How do I achieve same thing using table JOIN approach you suggested. -- View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Getting-exception-in-SQL-Query-JOINS-tp6674p6732.html Sent from the Apache Ignite Users mailing list archive at Nabble.com.