on-clause

    0熱度

    1回答

    ,這是好的,它會產生一個左連接 var q = from c in categories join p in products on c equals p.Category into ps from p in ps.DefaultIfEmpty() select new { Category = c, ProductName = p == null

    1熱度

    1回答

    我試圖在兩個生命表上執行右外連接— users_和expandovalue —獲取結果集。 當我對所有用戶做了以下查詢時,我得到了期望的結果。 SELECT USER_.FIRSTNAME , USER_.LASTNAME , USER_.EMAILADDRESS , USER_.JOBTITLE , expandovalue.data_ from exp

    1熱度

    1回答

    我正試圖在sqlalchemy核心中產生下面的sql。我無法獲得連詞AND或括號中的括號。,我使用 select from member t1 inner join member t2 on ( ( t1.first_name = t2.last_name and t1.last_name = t2.first_name and t1.dob

    0熱度

    1回答

    我需要在使用codeigniter活動記錄的左連接查詢上執行multiple on子句。 我寫這樣的代碼: $this->db->join('table1', 'table1.col1 = table2.id', 'left'); $this->db->where_not_in('table.col2', $list); 做這個笨添加哪裏都不條款,而我需要添加一個ON子句,與左側加入。 如果

    0熱度

    1回答

    有沒有辦法通過添加一些表達式來進一步限制連接?用我寫的普通SQL: SELECT c.*, COUNT(i.id) invoice_count FROM customers c LEFT JOIN invoices i ON i.customer_id = c.id AND i.creation_time >= '2012-01-01' -- <= extra restriction

    4熱度

    3回答

    我最近發現LEFT JOIN的ON子句可能包含如(1 = 1)這樣的值。 這讓我很不高興,因爲它打破了我對加入功能的看法。 我遇到的以下情況更詳盡的版本: SELECT DISTINCT Person.ID, ... FROM Person LEFT JOIN Manager ON (Manager.ID = Person.ID OR Manager.ID = -1)) WHERE (...

    0熱度

    1回答

    我目前正在使用Doctrine 2 ZF一個項目工作。到目前爲止一切順利。不過,我有一個看起來像一個錯誤的問題。 我已在我的倉庫之一寫入下面的代碼: ​​ 生成的SQL語句: SELECT a0_.coverLetter AS coverLetter0, [... lot of useless things], a0_.student_id AS student_id5, a0_.mission

    0熱度

    2回答

    我有這樣一個龐大複雜的查詢: @objects = Object.joins({ x: :y }).includes( [:s, { x: { y: :z } }, { l: :m },:q, :w, { important_thing: [:h, :v, :c,:l, :b, { :k [:u, :a] }] } ]).where(conditi

    1熱度

    2回答

    爲什麼這個簡單的查詢工作正常在Oracle中,但DB2不攜手在ON子句: select * from sysibm.dual d1 left join sysibm.dual d2 on 1=1 and exists (select 1 from sysibm.dual) 移動子查詢,包括條件,where子句可以幫助,但將限制外部連接到內部。