(select recharge_arrive_time as time,recharge_amount as amount,state,'充值' AS type from onlinerecharge where user_id=1)
UNION
(select confirm_time as time,withdraw_cash_amount as amount,state,'提现' AS type from withdrawcash where user_id=1)
UNION
(select i.create_time as time,i.investment_amount as amount,i.invest_state as state, b.bid_name as type from invest i
INNER JOIN bid b
on i.bid_id=b.bid_id
where i.user_id=1)
UNION
(select r.exact_repayment_time as time,r.should_repayment_amount as amount,r.state as state, b.bid_name as type from repayment r
INNER JOIN bid b
on r.bid_id=b.bid_id
where r.user_id=1)
UNION
(select created_date_long as time,reward_amount as amount,reward_source as state,reward_name AS type from investreward where user_id=1)
UNION
(select a.created_date_long as time,a.actual_amount as amount,ac.amount as state,'多利宝存入' as type from dollyadd a
INNER JOIN dollyflow f
on a.dolly_flow_id= f.dolly_flow_id
INNER JOIN dollyaccount ac
ON a.user_id = ac.user_id
where a.user_Id = 1)
UNION
(select r.redeeml_arrive_time as time,r.amount as amount,'' as state,'多利宝赎回' as type from dollyredeem r
INNER JOIN dollyflow f
ON r.dolly_flow_id=f.dolly_flow_id
where r.user_id=1)
UNION
(select u.hb_get_time as time,h.hongbao_amount as amount,h.hongbao_name as state,'红包奖励' as type from userhongbao u
INNER JOIN hongbao h
ON u.hongbao_id= h.hongbao_id
where user_id=1)
ORDER BY time DESC

查询多表集合(union)、查询时建临时字段、查询时给字段设置默认值的更多相关文章

  1. 《Entity Framework 6 Recipes》中文翻译系列 (14) -----第三章 查询之查询中设置默认值和存储过程返回多结果集

    翻译的初衷以及为什么选择<Entity Framework 6 Recipes>来学习,请看本系列开篇 3-6在查询中设置默认值 问题 你有这样一个用例,当查询返回null值时,给相应属性 ...

  2. 【杂记】mysql 左右连接查询中的NULL的数据筛选问题,查询NULL设置默认值,DATE_FORMAT函数

    MySQL左右连接查询中的NULL的数据筛选问题 xpression 为 Null,则 IsNull 将返回 True:否则 IsNull 将返回 False. 如果 expression 由多个变量 ...

  3. ant-design-pro弹出框表单设置默认值

    项目需求需要使用ant-design-pro的弹出框表单并在表单出现时设置默认值 然而按照官方的示例给 <Input> 标签设置 defaultValue 时发现并没有效果.如下所示: & ...

  4. java 反射: 当Timestamp类型的属性值为null时,设置默认值

    import java.beans.PropertyDescriptor; import java.lang.reflect.Field; import java.lang.reflect.Metho ...

  5. Vue 父组件传递给子组件,设置默认值为数组或者对象时

    在vue 父子组件传参过程中,传递对象或者数组时,设置默认值为{}或者[] 错误写法: props: { pos: { type: [Object, Array], default: []//这是错误 ...

  6. sql 列设置默认值,语法查询知识点积累

    一.修改字段默认值 alter table 表名 drop constraint 约束名字   ------说明:删除表的字段的原有约束 alter table 表名 add constraint 约 ...

  7. 【转载】mysql建表date类型不能设置默认值

    如题,mysql建表date类型的不能设置一个默认值,比如我这样: CREATE TABLE `new_table` ( `biryhday` datetime NULL DEFAULT '1996- ...

  8. .NET DateTime类型变量作为参数时设置默认值

    一个小的 Tips. .NET 中函数参数的默认值需要是编译时常量.如果参数是引用类型,可以设置Null,如果是值类型,可以设置相应的编译时常量,如整型可以用整数,但对于DateTime(结构体,值类 ...

  9. PHP 判断是表单否有这个参数,如果没有则设置默认值

    <?php @$name = $_GET["name"]; if(isset($name)) { echo "name = " .$name; } els ...

随机推荐

  1. selenium上传图片

    在我们使用selenium的时候碰到上传图片.文件时一般都可以先定位然后直接send_keys,但是有的却不行,selenium也没有提供其它的办法,只能靠第三方软件来解决 我们要借助一个叫AutoI ...

  2. java FastJSON的使用

    1.JSON介绍 JSON(javaScript Object Notation)是一种轻量级的数据交换格式.主要采用键值对({"name": "json"}) ...

  3. 基础篇:6.1)形位公差-要素 Feature

    本章目的:理解形位公差研究的对象-要素,即点.线.面. 1.定义 2.类型 2.1 按存在的状态分 2.2 按结构特征分 2.3 按所处的地位分 2.4  按结构性能分 2.5  按与尺寸关系分

  4. scikit-learn中predict_proba用法 (与predict的区别)

    predict_proba返回的是一个 n 行 k 列的数组, 第 i 行 第 j 列上的数值是模型预测 第 i 个预测样本为某个标签的概率,并且每一行的概率和为1. # conding :utf-8 ...

  5. vue.js学习笔记(一)——vue-cli项目的目录结构

    vue.js是一套构建用户界面的渐进式框架.vue采用自底向上增量开发的设计.vue的核心库只关心视图层,非常容易学习,非常容易与其它库和已有项目整合.vue完全有能力驱动采用单文件组件和vue生态系 ...

  6. bundle 与 package

    bundle是Apple提供的软件安装的便捷方法. bundle为用户和开发者提供了一个简单地接口. bundle 和 package package:看起来像一个文件的目录       bundle ...

  7. centos7 装机配置及 mysql 安装过程

    打开网卡,使操作系统可以上网 1 ip add 查看网卡,lo是回环网卡可以忽略,ens33为实际网卡. [root@localhost ~]# ip add 1: lo: <LOOPBACK, ...

  8. spark第八篇:与Phoenix整合

    spark sql可以与hbase交互,比如说通过jdbc,但是实际使用时,一般是利用phoenix操作hbase.此时,需要在项目中引入phoenix-core-4.10.0-HBase-1.2.j ...

  9. 正则表达式控制Input输入内容 ,js正则验证方法大全

    https://blog.csdn.net/xushichang/article/details/4041507 //输入姓名的正则校验 e.currentTarget.value = e.curre ...

  10. input获得焦点时改变placeholder文本的样式

    HTML: <input type="text" placeholder="sample text"/> CSS: input::-webkit-i ...