logo

Warning: The forum is now for consultation only. Please use GitHub Discussions to post any questions or comments.


Welcome Guest ! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
vicry21  
#1 Posted : Friday, November 11, 2016 6:49:52 AM(UTC)
vicry21

Rank: Member

Groups: Registered
Joined: 11/10/2016(UTC)
Posts: 14
China
Location: 江苏

Thanks: 2 times
I create bi report connect to mysql and had added a table to table list,
but i put column to page elements and run excute but no data,
so i found "View sql" :
"SELECT DISTINCT
ts_ty_project.project AS C0,
ts_ty_project.class AS C1,
ts_ty_project.realname AS C2,
ts_ty_project.xy AS C3
FROM ts_ty_project
WHERE 1=0
ORDER BY ts_ty_project.project ASC,ts_ty_project.class ASC,ts_ty_project.realname ASC,ts_ty_project.xy ASC
"


Why to have 'where 1=0'
epf  
#2 Posted : Friday, November 11, 2016 3:39:04 PM(UTC)
epf

Rank: Administration

Groups: Administrators
Joined: 12/20/2013(UTC)
Posts: 1,209
Switzerland

Thanks: 14 times
Was thanked: 206 time(s) in 199 post(s)
well, the 1=0 is only added when showing and/or checking the SQL, it is only for performances reason.
The restriction is of course removed when executing the report...
thanks 1 user thanked epf for this useful post.
vicry21 on 11/14/2016(UTC)
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.