Exemple #1
0
        public void TestConditionWhereJoinHaving()
        {
            // Query Principal
            var sqlRaw = "select * from test";
            var nsql   = new NSQLQuery(sqlRaw);

            // Query 2
            var nSubSql = new NSQLQuery();

            nSubSql.Having("coluna1", Op.IGUAL, "TESTE");

            // Adiciona sub query
            nsql.JoinHaving(nSubSql);

            var expected = "select * from test HAVING coluna1 = 'TESTE'";

            Assert.AreEqual(expected, nsql.ToSql(), true);
        }