我有2张桌子
CREATE TABLE `app_user_videos` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) DEFAULT NULL,
`filename` varchar(255) DEFAULT NULL,
`thumbnail` varchar(255) DEFAULT NULL,
`date` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8
CREATE TABLE `app_user_photos` (
`photo_id` int(11) NOT NULL AUTO_INCREMENT,
`photo_file_name` varchar(200) NOT NULL,
`photo_thumb` varchar(245) DEFAULT NULL,
`album_id` int(11) NOT NULL,
`server_created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`user_id` int(11) NOT NULL,
`photo_caption` varchar(200) DEFAULT 'This Caption',
PRIMARY KEY (`photo_id`),
KEY `photo_file_name` (`photo_file_name`,`album_id`,`server_created`,`user_id`,`photo_thumb`),
KEY `photo_caption` (`photo_caption`)
) ENGINE=MyISAM AUTO_INCREMENT=1840 DEFAULT CHARSET=latin1
我正在尝试编写一个sql语句,从两个表中选择WHERE user_id IN(38,24,56)然后按日期排序....我尝试进行连接并选择但我没有数据。我尝试从两者中进行选择并加入user_id