mysql如何日期筛选
迷茫
迷茫 2017-04-17 15:29:24
0
1
632
-- phpMyAdmin SQL Dump
-- version 4.0.10.14
-- http://www.phpmyadmin.net
--
-- 主机: localhost:3306
-- 生成日期: 2016-08-24 00:16:24
-- 服务器版本: 5.6.30-cll-lve
-- PHP 版本: 5.6.20

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;

--
-- 数据库: `student`
--

-- --------------------------------------------------------

--
-- 表的结构 `student`
--

CREATE TABLE IF NOT EXISTS `student` (
  `id` varchar(20) NOT NULL,
  `name` varchar(50) NOT NULL,
  `fraction` int(20) NOT NULL,
  `date` date NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- 转存表中的数据 `student`
--

INSERT INTO `student` (`id`, `name`, `fraction`, `date`) VALUES
('1', 'student', 100, '2016-08-23'),
('2', 'student', 95, '2016-08-22'),
('3', 'student2', 100, '2016-08-23'),
('4', 'student2', 200, '2016-08-22'),
('5', 'student3', 350, '2016-08-23'),
('6', 'student3', 450, '2016-08-22'),
('7', 'student4', 50, '2016-08-23'),
('8', 'student4', 100, '2016-08-22'),
('9', 'student5', 900, '2016-08-23'),
('10', 'student5', 930, '2016-08-22');

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;

如何进行筛选
比如只需要2016-08-22

迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

reply all(1)
伊谢尔伦

I seem to have seen similar questions and similar data somewhere. This kind of filtering can be compared directly:

select * from student where date = '2016-08-22';
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template