Click here to Skip to main content
16,007,126 members
Home / Discussions / Database
   

Database

 
AnswerRe: Which database format is good enough? Pin
Jerry Hammond5-Oct-06 9:08
Jerry Hammond5-Oct-06 9:08 
QuestionLeft Join & Group By Pin
phimix5-Oct-06 4:40
phimix5-Oct-06 4:40 
AnswerRe: Left Join & Group By Pin
mr_lasseter5-Oct-06 4:52
mr_lasseter5-Oct-06 4:52 
QuestionRe: Left Join & Group By Pin
phimix5-Oct-06 5:17
phimix5-Oct-06 5:17 
AnswerRe: Left Join & Group By Pin
mr_lasseter5-Oct-06 5:34
mr_lasseter5-Oct-06 5:34 
QuestionRe: Left Join & Group By Pin
phimix5-Oct-06 6:02
phimix5-Oct-06 6:02 
QuestionRe: Left Join & Group By Pin
mr_lasseter5-Oct-06 6:06
mr_lasseter5-Oct-06 6:06 
AnswerRe: Left Join & Group By Pin
phimix5-Oct-06 7:01
phimix5-Oct-06 7:01 
What I want are the 3 rows in the pb table with the highest rating.

If these rows have a match (id) in the pv table, I want a row of pv information for each pb row as well. The information in pv is only relevant if lastwin_year and lastwin_month match the $current_year and $current_month parameters. No information should be retrieved from pv if no matching lastwin_year/lastwin_month can be found. Place should be as low as possible.

For example:

pb
---
id = 1, rating 56
id = 2, rating 63
id = 3, rating 42
id = 4, rating 70

pv
---
id = 2, lastwin_year 2006, lastwin_month 10, place 3
id = 2, lastwin_year 2006, lastwin_month 10, place 1
id = 3, lastwin_year 2006, lastwin_month 7, place 3
id = 4, lastwin_year 2005, lastwin_month 8, place 3
id = 4, lastwin_year 2005, lastwin_month 9, place 3

desired result ($current_year = 2006, $current_month = 10)
---
id = 4, rating 70, NULL
id = 2, rating 63, lastwin_year 2006, lastwin_month 10, place 1
id = 1, rating 56, NULL


GeneralRe: Left Join & Group By [modified] Pin
mr_lasseter5-Oct-06 7:44
mr_lasseter5-Oct-06 7:44 
GeneralRe: Left Join & Group By Pin
phimix5-Oct-06 19:34
phimix5-Oct-06 19:34 
QuestionRecord 'Deletion' Pin
Dayekh5-Oct-06 3:56
Dayekh5-Oct-06 3:56 
AnswerRe: Record 'Deletion' Pin
mr_lasseter5-Oct-06 5:44
mr_lasseter5-Oct-06 5:44 
GeneralRe: Record 'Deletion' Pin
Dayekh5-Oct-06 23:12
Dayekh5-Oct-06 23:12 
AnswerRe: Record 'Deletion' Pin
Private_Void6-Oct-06 9:16
Private_Void6-Oct-06 9:16 
QuestionPass wild card value to Where Like Statement. Pin
japel5-Oct-06 0:36
japel5-Oct-06 0:36 
AnswerRe: Pass wild card value to Where Like Statement. Pin
albCode5-Oct-06 0:41
albCode5-Oct-06 0:41 
GeneralRe: Pass wild card value to Where Like Statement. Pin
japel5-Oct-06 1:06
japel5-Oct-06 1:06 
AnswerRe: Pass wild card value to Where Like Statement. Pin
Chris Meech5-Oct-06 2:06
Chris Meech5-Oct-06 2:06 
QuestionSQL server connectivity Problem: Pin
Shahzad.Aslam4-Oct-06 23:30
Shahzad.Aslam4-Oct-06 23:30 
AnswerRe: SQL server connectivity Problem: Pin
Jerry Hammond5-Oct-06 2:35
Jerry Hammond5-Oct-06 2:35 
AnswerRe: SQL server connectivity Problem: Pin
Mike Osbahr6-Oct-06 10:51
Mike Osbahr6-Oct-06 10:51 
GeneralRe: SQL server connectivity Problem: Pin
Shahzad.Aslam8-Oct-06 18:28
Shahzad.Aslam8-Oct-06 18:28 
QuestionTable change event Pin
RoyRose784-Oct-06 23:27
RoyRose784-Oct-06 23:27 
AnswerRe: Table change event Pin
Chris Buckett5-Oct-06 8:55
Chris Buckett5-Oct-06 8:55 
QuestionReg. Query Pin
aaraaayen4-Oct-06 21:17
aaraaayen4-Oct-06 21:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.