Mam dwie takie tabele
CREATE TABLE IF NOT EXISTS `sprawdz` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`id_url` int(11) NOT NULL,
`first_test` int(11) DEFAULT NULL,
`first_test_date` datetime DEFAULT NULL,
`secoud_test` int(11) DEFAULT NULL,
`secoud_test_date` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `id_url` (`id_url`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
CREATE TABLE IF NOT EXISTS `urls` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL,
`clients_id` int(11) NOT NULL,
`typs` varchar(10) NOT NULL,
`date_insert` date NOT NULL,
`url_connected` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `clients_id` (`clients_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
ALTER TABLE `sprawdz`
ADD CONSTRAINT `user_system_id_fk3` FOREIGN KEY (`id_url`) REFERENCES `urls` (`id`) ON DELETE CASCADE;
Jak wyświetlić `name` z URLS wraz z `first_test` z SPRAWDZ w jednym zapytaniu?
Ten post edytował danussiaaa 23.12.2012, 02:55:52