leisure Posted December 6, 2005 Report Share Posted December 6, 2005 Kaads man wareetu paskaidrot atskiriibu starp LEFT, INNTER, RIGHT JOIN???? Man ir jaatlasa no tabulas dati, bet, piem, laukaa `main_id` glabaajas citas tabulas id ieraksts ( pienjemsim, ka otrajaa tabulaa ir tikai `id` un `value`), kaaa man jasaliek tas join lai atlasot datus no pirmaas tabulas, lauka $row["main_id"] veertiiba buutu attieciigaa veertiiba no otraas tabulas? Link to comment Share on other sites More sharing options...
tamster Posted December 6, 2005 Report Share Posted December 6, 2005 Kaads man wareetu paskaidrot atskiriibu starp LEFT, INNTER, RIGHT JOIN???? Man ir jaatlasa no tabulas dati, bet, piem, laukaa `main_id` glabaajas citas tabulas id ieraksts ( pienjemsim, ka otrajaa tabulaa ir tikai `id` un `value`), kaaa man jasaliek tas join lai atlasot datus no pirmaas tabulas, lauka $row["main_id"] veertiiba buutu attieciigaa veertiiba no otraas tabulas? Tavā gadījumā ir pavisam vienkārši: SELECT * FROM tabula1 a LEFT JOIN tabula2 b ON a.main_id = b.id Link to comment Share on other sites More sharing options...
leisure Posted December 6, 2005 Author Report Share Posted December 6, 2005 Tavā gadījumā ir pavisam vienkārši:SELECT * FROM tabula1 a LEFT JOIN tabula2 b ON a.main_id = b.id Sorr, bet bik neiebraucu tajaa a un b tie ir domaati kaa tabula 1 as a wai kaa? Link to comment Share on other sites More sharing options...
bubu Posted December 6, 2005 Report Share Posted December 6, 2005 http://php.lv/f/index.php?s=&showtopic=234...indpost&p=16745 Link to comment Share on other sites More sharing options...
leisure Posted December 6, 2005 Author Report Share Posted December 6, 2005 Paldies, bubu, DER!!! aaa un wai war raxtiit wairaakus joinus? Man te ir kluuda: mySQL query error: SELECT country_year_id, country_data_kulturas_id, country_meslojums_exp, country_is_miglots FROM db_country_data_full JOIN db_country_data_years ON country_year_id.db_country_data_full = id.db_country_data_years mySQL error: You have an error in your SQL syntax near 'ON country_year_id.db_country_data_full = id.db_country_data_years ' Newaru atkost :P Link to comment Share on other sites More sharing options...
bubu Posted December 6, 2005 Report Share Posted December 6, 2005 kolonnas nosaukumu raksta pēc tabulas nosaukuma. TABULA.KOLONA nevis KOLONA.TABULA Link to comment Share on other sites More sharing options...
leisure Posted December 6, 2005 Author Report Share Posted December 6, 2005 Jaa paa to tabula.kollona ir man vispar fataals errors... laikam esmu appiipeejies :P Bet mysql niid ka errors esot aiz ON arii peec tikko izlabotaaas kljuudas? Tur jaliek buutu kaadas quotes wai ` ? Link to comment Share on other sites More sharing options...
Grey_Wolf Posted December 7, 2005 Report Share Posted December 7, 2005 kaa jau bubu teica sintakse DB.tabula.row`s un nekaa savaadaak ! pamegini ielikt lauka pierakstus ' ' vai ieksh ` ` Link to comment Share on other sites More sharing options...
bubu Posted December 7, 2005 Report Share Posted December 7, 2005 pamegini ielikt lauka pierakstus ' ' vai ieksh ` ` priekškam? nav viņam tur rezervēto vārdu tak. Link to comment Share on other sites More sharing options...
leisure Posted December 7, 2005 Author Report Share Posted December 7, 2005 nej nej, '' vai `` nau pie vainais... ieliku LEFT JOIN un viss aizgaaja, paldies par paliidziibu, bet kameer sapratiishu tos RIGHT un INNTER un weu tur kaadi tie JOIN bija paies laix... neviens jau man neatbildeeja... :/ A nevar izdariit taa, ka datus aizvieto nevis pievieno... kaa sanaak ar JOIN dati pievienojas, bet kaa war aizvietot? Teiksim taa, ka laukaa 'pid' ir lauka 'sid' id un lauks pid aizvietojas ar lauku sid???? Link to comment Share on other sites More sharing options...
bubu Posted December 8, 2005 Report Share Posted December 8, 2005 nu selektā tad arī tā raksti: nevis SELECT pid FROM ... bet gan SELECT sid FROM ... Link to comment Share on other sites More sharing options...
Recommended Posts