I have two tables query: However I can not represent SQLLame about it. I can I have come with this snippet: Although this works but you do not call it as an answer Because it appears a hack is another reason why the Beard and
mustache is defined as follows: < / P>
+ -------- + --------- + ------------ + -------- ------ + | Person Beard Beard style | Beard length + -------- + --------- + ------------ + ------------- + + - - ----- + ------------- + ---------------- + | Person Mostaked | Miststyle | + -------- + ------------- + ---------------- + < P> I have created a SQL query in PostgreSQL, which would will combine these two tables and generates the following results:
+ -------- + ------- - + ------------ + ------------- + ------------- + ------ - -------- + | Person Beard Beard style | Beard length Mostaked | Miststyle | + -------- + --------- + ------------ + ------------- + --- ---------- + ---------------- + | Bob | 1 | Rutatin | 1 | | | + -------- + --------- + ------------ + ------------- + --- ---------- + ---------------- + | Bob | 2 | Samson | 12 | | | + -------- + --------- + ------------ + ------------- + --- ---------- + ---------------- + | Bob | | | | 1 | Fu Manchu | + -------- + --------- + ------------ + ------------- + --- ---------- + ---------------- +
(false) select the upper seals beard encounters (false) where the person = "Bob" Unias select all * stop b and out of the mouth of the beards (false) where the person = "Bob"
from_statement and
exclusion tried many ways to implement but none of them did not actually work there to help me with it?
q1 = Session. \ Query (beard. Pirs. Label ( 'person'), Dadhikbiaidiaidi. Elelbiel ( 'Biyrdiaidi'), shave. Beyrstail. Label ( "beard style"), Sclalikmi SQL. Tap (). Label ( 'Muscad') , Skelechme. Sql.null (). Label ('Mustest Style'),). Filter (beard viewer == 'Bob') q2 = session. Labeled ('beardID'), sqlalchemy.sql.null (). Label ('beardStyle'), Mostach.Mostach, Mostach.Most: Style, ). Filter (Moustache.person == 'bob') Results = q1.union (q2) .all ()
should be in the right outer join sqlalchemy
Comments
Post a Comment