Jump to content
php.lv forumi

selektojam vienu datu no diviem.


anonīms

Recommended Posts

tabula 1_tipa_speeles (id, kas_spele, pret_ko_spele, uploadots, iemesti, ielaisti, OT)

Dati iekšā izskatās šādi (Pieņemsim, ka es esmu ar ID 10, bet Tu ar 5

 

id, kas_spele, pret_ko_spele, iemesti, ielaisti, OT

1, 10, 5, 4, 1, 0

2, 5, 10, 1, 4, 0

Patreizējais kods:http://paste.php.lv/2004509eeb54e022b7bf33cbdfdab4e4?lang=php

Kā varētu dabūt gatavu, ka izvelk tikai vienu datu no šiem abiem?

Paldies

Edited by anonīms
Link to comment
Share on other sites

vajadzēja ieviest kkādu game_id, kurš drīkst atkārtoties tajā rezultātu tabulā, un tad vienu rezultātu (pirmo no abiem) varētu paņemt izmantojot GROUP BY game_id

 

šis nav standarta GROUP BY pielietojums, taču tas strādā ;)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...