| |

VerySource

 Forgot password?
 Register
Search
View: 908|Reply: 3

Strange problem: no output columns in the view definition or no items in the FROM clause

[Copy link]

1

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-1-27 12:00:01
| Show all posts |Read mode
I am trying to create a new view, but an error occurs, prompt: no output column in the view definition or no items in the FROM clause
code show as below:
SELECT id, num
FROM table1
WHERE num> 0
UNION ALL
SELECT id, qt as num
FROM table2
WHERE qt> 0
Reply

Use magic Report

0

Threads

88

Posts

55.00

Credits

Newbie

Rank: 1

Credits
55.00

 China

Post time: 2020-2-20 18:15:01
| Show all posts
There is no problem with the statement ~~~
Reply

Use magic Report

0

Threads

114

Posts

69.00

Credits

Newbie

Rank: 1

Credits
69.00

 China

Post time: 2020-2-20 18:45:01
| Show all posts
Is there a problem with the condition? LZ query separately to see if there are results
Reply

Use magic Report

0

Threads

211

Posts

108.00

Credits

Newbie

Rank: 1

Credits
108.00

 China

Post time: 2020-2-21 00:15:01
| Show all posts
--try

create view VI
as
SELECT id, num
FROM table1
WHERE num> 0
UNION ALL
SELECT id, qt as num
FROM table2
WHERE qt> 0
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list