UnlikePC Posted January 5, 2011 Report Share Posted January 5, 2011 Piemeram gribu savienot triis tabulas - lietotaji,pasutijumi un pasutijumu_rekveziti. Tabula lietotaji : id Vards Uzvards pass Tabula pasutijumi : id Datums lietotaja_id Tabula pasutijumu_rekveziti : pasutijuma_id preces_id daudzums Cena Veletos lai view izkatitos sads : Datums Preces nosaukums Preces cena Daudzums Cena Piemeram lietotajs ar id = 19 skatas savu pirkuma vesturi. Atlasa ierakstus tabulaa pasutijumi kur lietotaja_id = ar id kas ir lietotaji tabulaa. Un tabulaa pasutijumu_rekveziti atlasa pec pasutijuma_id. Cik sapratu ka primaro atslegu pasutijumu_rekveziti nav obligati taisit. Quote Link to comment Share on other sites More sharing options...
UnlikePC Posted January 5, 2011 Author Report Share Posted January 5, 2011 Gribu zinat ka jaaizkataas $qry Quote Link to comment Share on other sites More sharing options...
Gints Plivna Posted January 5, 2011 Report Share Posted January 5, 2011 sākums http://datubazes.wordpress.com/2008/02/11/sql-join-i/'>http://datubazes.wordpress.com/2008/02/11/sql-join-i/ Visdrīzāk, ka Tev vajag vai nu iekšējo savienojumu, vai ārējo savienojumu. Gints Plivna http://datubazes.wordpress.com Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.