Forum » Programiranje » SQL problem
SQL problem
darh ::
en manjsi problemcek... kako naredit LEFT OUTER JOIN z eno "levo" tabelo pa dvema "desnima"... zdej mam tkole:
ampak mi ne prikaze tistih novic, k imajo sourceID = 0 !! zato bi pa rabu LEFT OUTER JOIN med zNews pa zNews_sources ampak ga mam ze med zNews pa zNews_comments
damn...
če kdo ve... plz... let me know...
FROM zNews n LEFT OUTER JOIN zNews_comments c ON n.id = c.newsID, zNews_sources s, users u
WHERE n.visible = "true" AND s.id = n.sourceID AND u.userID = n.writerID
ampak mi ne prikaze tistih novic, k imajo sourceID = 0 !! zato bi pa rabu LEFT OUTER JOIN med zNews pa zNews_sources ampak ga mam ze med zNews pa zNews_comments
damn...
če kdo ve... plz... let me know...
Excuses are useless! Results are priceless!
- spremenil: darh ()
strel ::
Pa ka vi sql stavke na roke pišete ???
ACCES si zalaufi pa query nares grafično pa ti bo SQL zgeneriral ti pa sam kak parameter popraviš, al pa jst pojma nimam ???
ACCES si zalaufi pa query nares grafično pa ti bo SQL zgeneriral ti pa sam kak parameter popraviš, al pa jst pojma nimam ???
darh ::
no .. strel.. pa ti zalaufej ACCESS pa reš tale problem... nekak ne znam nc v accessu delat pa še z debilnimi MS produkti se mi ne da ukvarjat...
Excuses are useless! Results are priceless!
tonic ::
pod VFPjem bi to naredo tak:
select ... from leva left outer join desna1 on leva.id_l=desna1.id_d1 left outer join desna2 on desna1.id_d1=desna2.id_d2 where ...
ampak pazi: outer ti nafila polja z NULL vrednostmi če v tabeli ki jo joinaš ni zapisa
za tistega en post pred mano:
INNER pa OUTER mata čist drugo vlogo kot pa da bi povezovala JOINe
INNER JOIN specifies that the query result contains only rows from a table that match one or more rows in another table.
LEFT [OUTER] JOIN specifies that the query result contains all rows from the table to the left of the JOIN keyword and only matching rows from the table to the right of the JOIN keyword. The OUTER keyword is optional; it can be included to emphasize that an outer join is created.
RIGHT [OUTER] JOIN specifies that the query result contains all rows from the table to the right of the JOIN keyword and only matching rows from the table to the left of the JOIN keyword. The OUTER keyword is optional; it can be included to emphasize that an outer join is created.
FULL [OUTER] JOIN specifies that the query result contains all matching and non matching rows from both tables. The OUTER keyword is optional; it can be included to emphasize that an outer join is created.
ON JoinCondition specifies the conditions for which the tables are joined.
select ... from leva left outer join desna1 on leva.id_l=desna1.id_d1 left outer join desna2 on desna1.id_d1=desna2.id_d2 where ...
ampak pazi: outer ti nafila polja z NULL vrednostmi če v tabeli ki jo joinaš ni zapisa
za tistega en post pred mano:
INNER pa OUTER mata čist drugo vlogo kot pa da bi povezovala JOINe
INNER JOIN specifies that the query result contains only rows from a table that match one or more rows in another table.
LEFT [OUTER] JOIN specifies that the query result contains all rows from the table to the left of the JOIN keyword and only matching rows from the table to the right of the JOIN keyword. The OUTER keyword is optional; it can be included to emphasize that an outer join is created.
RIGHT [OUTER] JOIN specifies that the query result contains all rows from the table to the right of the JOIN keyword and only matching rows from the table to the left of the JOIN keyword. The OUTER keyword is optional; it can be included to emphasize that an outer join is created.
FULL [OUTER] JOIN specifies that the query result contains all matching and non matching rows from both tables. The OUTER keyword is optional; it can be included to emphasize that an outer join is created.
ON JoinCondition specifies the conditions for which the tables are joined.
darh ::
ejga.. tonic.. najlepša ti dala !
lih to sm isku... bom jutr probu, ce dela tko kt je treba !
lih to sm isku... bom jutr probu, ce dela tko kt je treba !
Excuses are useless! Results are priceless!
Vredno ogleda ...
Tema | Ogledi | Zadnje sporočilo | |
---|---|---|---|
Tema | Ogledi | Zadnje sporočilo | |
» | [SQL] Pohitritev izpisaOddelek: Programiranje | 2971 (1870) | kuall |
» | [SQL] teževa pri iskanju zapisovOddelek: Programiranje | 2116 (1706) | lopow |
» | SQL - izpitOddelek: Programiranje | 2048 (1072) | FTad |
» | MySQL join problemOddelek: Programiranje | 1547 (1445) | Poldi112 |
» | pgSQL problem z indexi...Oddelek: Izdelava spletišč | 1169 (1079) | Tito |