Hi all...
I have 2 tables
Struttura della tabella `gare`
CREATE TABLE `gare` (
`race_id` tinyint(3) NOT NULL default '0',
`pos_gara` tinyint(2) NOT NULL default '0',
`nome_pilota` varchar(50) NOT NULL default '',
`auto` varchar(50) NOT NULL default '',
`giri_gara` tinyint(3) NOT NULL default '0',
`tempo_gara` varchar(20) NOT NULL default '',
`gap_gara` varchar(20) NOT NULL default '',
`fastest_laptime` varchar(20) NOT NULL default '',
`fastest_lapnr` tinyint(3) NOT NULL default '0',
`pos_quali` tinyint(2) NOT NULL default '0',
`tempo_quali` varchar(20) NOT NULL default '',
`gap_quali` varchar(20) NOT NULL default ''
) TYPE=MyISAM;
Struttura della tabella `drivers`
CREATE TABLE `drivers` (
`driver_id` int(3) unsigned NOT NULL auto_increment,
`nome` varchar(40) NOT NULL default '',
`numero` int(3) NOT NULL default '0',
`nick` varchar(40) NOT NULL default '',
`auto` varchar(150) NOT NULL default '',
`team` varchar(40) NOT NULL default '',
`logo` varchar(150) NOT NULL default '',
KEY `driver_id` (`driver_id`)
) TYPE=MyISAM AUTO_INCREMENT=8 ;
where the first table has all the results of every single race with the following format
RACE_ID - DRIVER POSITION - DRIVER NAME - CAR - LAPS and so on...
the second table is a list of all the drivers of the league
DRIVER_ID - NAME - NUMBER - NICK and so on...
"DRIVER NAME" of TAB1 has the same value of "NAME" of TAB2
now I need to make a query to COUNT how many time every driver appear in the RACES (gare) TABLE in order to have a list of ALL THE DRIVERS showing
DRIVER NAME - TOTAL RACES
I tryed some JOIN but I really can't have more than a driver listed 🙁
hope someone will help me
Roberto