Ciao a tutti,
ho un problema con una query
Ma prima vi mostro le tabelle
Tabella user_appeal
`user_appeals_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`user_appeals_users_facebook_id` bigint(20) unsigned NOT NULL,
`user_appeals_insert_data` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`user_appeals_appeals_id` int(10) unsigned NOT NULL DEFAULT 0,
`user_appeals_invited_user_facebook_id` bigint(20) unsigned NULL DEFAULT NULL,
`user_appeals_complete_group_id` bigint(20) unsigned NULL DEFAULT NULL,
PRIMARY KEY (`user_appeals_id`)
Tabella appeal
`appeals_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`appeals_score` int(5) NOT NULL,
`appeals_description` text NOT NULL,
PRIMARY KEY (`appeals_id`)
l'unione tra le tabelle avviene con `appeals_id` e `user_appeals_appeals_id`.
Ora io vorrei ottenere un risultato come questo:
Domanda è possibile e se si come faccio?codice:appeals_score appeals_description count di user_appeals_appeals_id 10 desc1 3 (C'è 3 volte l'id della tabella appeals nella tabella user_appeals) 20 desc2 2 (C'è 2 volte l'id della tabella appeals nella tabella user_appeals) 30 desc3 0 (Non c'è l'id della tabella appeals nella tabella user_appeals)
Grazie a tutti in anticipo

Rispondi quotando
