Lepsi komentare SQL :-)
This commit is contained in:
parent
39fb659ddb
commit
5ada37c5ed
1 changed files with 4 additions and 4 deletions
|
@ -398,15 +398,15 @@ def check_tema():
|
|||
-- TvCNode má dva potomky, oba TextNode. První drží původní text zadání, druhý řešení.
|
||||
INNER JOIN seminar_nodes_temavcisle AS tvcn ON tvcn.tema_id = id
|
||||
INNER JOIN seminar_nodes_treenode AS ttn ON tvcn.treenode_ptr_id = ttn.id
|
||||
LEFT OUTER JOIN seminar_nodes_treenode AS zad_tn ON ttn.first_child_id = zad_tn.id -- jen 33 z nich
|
||||
LEFT OUTER JOIN seminar_nodes_treenode AS res_tn ON zad_tn.succ_id = res_tn.id -- jen 4 z nich
|
||||
LEFT OUTER JOIN seminar_nodes_treenode AS zad_tn ON ttn.first_child_id = zad_tn.id -- jen 33 z nich ma zadani
|
||||
LEFT OUTER JOIN seminar_nodes_treenode AS res_tn ON zad_tn.succ_id = res_tn.id -- jen 4 z nich ma reseni
|
||||
LEFT OUTER JOIN seminar_nodes_obsah AS zad_on ON zad_on.treenode_ptr_id = zad_tn.id
|
||||
LEFT OUTER JOIN seminar_nodes_obsah AS res_on ON res_on.treenode_ptr_id = res_tn.id
|
||||
LEFT OUTER JOIN seminar_texty AS zad_text ON zad_on.text_id = zad_text.id
|
||||
LEFT OUTER JOIN seminar_texty AS res_text ON res_on.text_id = res_text.id -- vsechny 4
|
||||
-- Ročník tématu:
|
||||
-- Podle rootu TvCN
|
||||
LEFT OUTER JOIN seminar_nodes_rocnik AS rn ON ttn.root_id = rn.treenode_ptr_id -- nic
|
||||
-- Podle rootu TvCN to nejde
|
||||
LEFT OUTER JOIN seminar_nodes_rocnik AS rn ON ttn.root_id = rn.treenode_ptr_id
|
||||
|
||||
ORDER BY problem_ptr_id"""
|
||||
same_fields = ['text_zadani', 'text_reseni', 'rocnik_id']
|
||||
|
|
Loading…
Reference in a new issue