1
0
mirror of https://github.com/gnosygnu/xowa.git synced 2026-03-02 03:49:30 +00:00
This commit is contained in:
gnosygnu
2015-08-17 02:09:16 -04:00
parent 34c34f227c
commit df10db140c
421 changed files with 4867 additions and 2429 deletions

View File

@@ -56,7 +56,7 @@ public class Db_qry__select_in_tbl implements Db_qry {
if (having_sql != null) sb.Add(having_sql);
if (order_by_sql != null) {sb.Add(" ORDER BY "); sb.Add(order_by_sql);}
if (limit_sql != null) sb.Add(limit_sql);
return sb.XtoStr();
return sb.To_str();
}
}
public static Db_qry__select_in_tbl new_(String base_table, String[] where_flds, String[] select_flds, String[] order_flds) {

View File

@@ -72,18 +72,18 @@ public class Db_qry_select_tst {
// @Test public void GroupBy() {
// cmd.From_("tbl0").groupBy_("fld0", "fld1");
// expd = "SELECT fld0, fld1 FROM tbl0 GROUP BY fld0, fld1";
// Tfds.Eq(cmd.XtoStr(), expd);
// Tfds.Eq(cmd.To_str(), expd);
// }
// @Test public void Union() {
// cmd.From_("tbl0").select("fld0").union_(qry2.from("tbl1").select("fld0"));
// cmd.From_("tbl0").select("fld0").union_().from("tbl1").select("fld0"); // feasible, but will be bad later when trying to access Db_qry__select_cmd props
// expd = "SELECT fld0 FROM tbl0 UNION SELECT fld0 FROM tbl1";
// Tfds.Eq(cmd.XtoStr(), expd);
// Tfds.Eq(cmd.To_str(), expd);
// }
// @Test public void Having() {
// cmd.From_("tbl0").groupBy_("fld0", "fld1");
// expd = "SELECT fld0, fld1 FROM tbl0 GROUP BY fld0, fld1 HAVING Count(fld0) > 1";
// Tfds.Eq(cmd.XtoStr(), expd);
// Tfds.Eq(cmd.To_str(), expd);
// }
void tst_XtoStr(Db_qry qry, String expd) {Tfds.Eq(expd, cmd.Xto_sql());}
}