Select temp, DATE_FORMAT(temp,'%b-%d') from test
where temp between
concat(year(now()),'-',month(now()) -3,'-', DATE_FORMAT(now(), '%d'))
and
(curdate());
Run Code Online (Sandbox Code Playgroud)
我正在使用此查询获取3个月的数据,包括每周7天,但我没有按预期获得结果,如何通过此查询获取每周5天的数据并忽略数据库中的周末数据.
在TextInput中输入电子邮件时,它应根据输入的电子邮件是否有效来验证并显示错误消息?我正在使用tcomb表单验证.如何以tcomb形式添加电子邮件验证?下面是代码.
import React, { Component } from 'react';
import {
AppRegistry,
Text,
Image,
View,
Button,
StyleSheet,
TextInput,
Linking,
Alert,
Navigator
} from 'react-native';
import t from 'tcomb-form-native';
const Form = t.form.Form;
// here we are: define your domain model
const LoginFields = t.struct({
username: t.String, // a required string
password: t.String, // a required string
});
const options = {
fields: {
password: {
type: 'password',
placeholder: 'Password',
},
username: {
placeholder: 'e.g: abc@gmail.com',
error: 'Insert a valid email'
} …
Run Code Online (Sandbox Code Playgroud)