From dba57690c10397235f8422c33a757e377941907a Mon Sep 17 00:00:00 2001 From: tianhe1986 Date: Mon, 13 Feb 2017 17:20:10 +0800 Subject: Add user-guide. Signed-off-by: tianhe1986 --- user_guide_src/source/database/query_builder.rst | 46 ++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/user_guide_src/source/database/query_builder.rst b/user_guide_src/source/database/query_builder.rst index 3135f76da..2d954c7a8 100644 --- a/user_guide_src/source/database/query_builder.rst +++ b/user_guide_src/source/database/query_builder.rst @@ -452,6 +452,52 @@ setting it to FALSE. Identical to having(), only separates multiple clauses with "OR". +**$this->db->having_in()** + +Generates a HAVING field IN ('item', 'item') SQL query joined with AND if +appropriate + +:: + + $names = array('Frank', 'Todd', 'James'); + $this->db->having_in('username', $names); + // Produces: HAVING username IN ('Frank', 'Todd', 'James') + + +**$this->db->or_having_in()** + +Generates a HAVING field IN ('item', 'item') SQL query joined with OR if +appropriate + +:: + + $names = array('Frank', 'Todd', 'James'); + $this->db->or_having_in('username', $names); + // Produces: OR username IN ('Frank', 'Todd', 'James') + +**$this->db->having_not_in()** + +Generates a HAVING field NOT IN ('item', 'item') SQL query joined with +AND if appropriate + +:: + + $names = array('Frank', 'Todd', 'James'); + $this->db->having_not_in('username', $names); + // Produces: HAVING username NOT IN ('Frank', 'Todd', 'James') + + +**$this->db->or_having_not_in()** + +Generates a HAVING field NOT IN ('item', 'item') SQL query joined with OR +if appropriate + +:: + + $names = array('Frank', 'Todd', 'James'); + $this->db->or_having_not_in('username', $names); + // Produces: OR username NOT IN ('Frank', 'Todd', 'James') + **************** Ordering results **************** -- cgit v1.2.3-24-g4f1b