where clause return empty row in view mysql

i have two tables with the schema below:

INCOME TABLE: INCOME_ID, INCOME_NAME, INCOME_DATE  OUTCOME TABLE: OUTCOME_ID, OUTCOME_NAME, OUTCOME_DATE  EXAMPLE DATA INCOME INCOME_ID | INCOME_NAME | INCOME_DATE 1         | FIRST EXMPL | 24-07-2016 2         | SEC EXAMPLE | 25-07-2016 ETC EXAMPLE DATA OUTCOME OUTCOME_ID | OUTCOME_NAME | OUTCOME_DATE 1          | FIRST        | 24-07-2016 2          | SEC          | 03-08-2016 ETC 

so i use union all to combine these table

SELECT INCOME_DATE AS DATE, INCOME_NAME AS NAME FROM INCOME UNION ALL SELECT OUTCOME_DATE, OUTCOME NAME FROM OUTCOME 

and i use query above to create view

CREATE VIEW V_BALANCE AS SELECT INCOME_DATE AS DATE, INCOME_NAME AS NAME UNION ALL SELECT OUTCOME_DATE, OUTCOME_NAME FROM OUTCOME 

the view was succesfully created but when i want to add where clause in view, it returns empty row

SELECT * FROM V_BALANCE WHERE DATE BETWEEN = '24-07-2016' AND '03-08-2016' 

Replay

Category: mysql Time: 2016-07-28 Views: 0
Tags: mysql view union

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development

search

Front-end development

Database

development tools

Open Platform

Javascript development

.NET development

cloud computing

server

Copyright (C) avrocks.com, All Rights Reserved.

processed in 0.138 (s). 12 q(s)