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
jovanni  
#1 Posted : Monday, November 24, 2014 1:45:13 PM(UTC)
jovanni

Rank: Member

Groups: Registered
Joined: 10/29/2014(UTC)
Posts: 12
Italy
Location: Schio

Hi all,

I got a righ join and I don't know how to avoid WHERE clause

If I run the following select, then the result is empty

SELECT
FASE4.IdFa4 AS C0,
FASE4.BioTransp AS C1,
FASE3.IdF4 AS C2,
FASE3.BioTransp AS C3,
FASE3.DataLogger AS C4
FROM
(FASE4 RIGHT OUTER JOIN FASE3
ON FASE4.IdFa4 = FASE3.IdF4)
WHERE 1=0
ORDER BY FASE4.IdFa4 ASC,FASE4.BioTransp ASC,FASE3.IdF4 ASC,FASE3.BioTransp ASC,FASE3.DataLogger ASC

If I use the same instead from database side without (deleting) WHERE 1=0
It works as expected.

I don't understand becouse I'm not able to avoid the empty result or removing the WHERE 1=0 clause.
From wich poit it comes out ?

Edited by user Monday, November 24, 2014 1:46:55 PM(UTC)  | Reason: Not specified

epf  
#2 Posted : Monday, November 24, 2014 7:22:41 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)
Yes, good question indeed,

the 1=0 is used to Check SQL only in order to made a quick check, not to perform the actual query when you execute the report...
I wonder if I should hide to avoid misunderstanding like you had.

Note that the query used may depends on the restrictions selected (if you have prompted restrictions), however you can have a look at the SQL generated without the 1=0, just click on the Model property "SQL Statement" "<Expand to view SQL>"

jovanni  
#3 Posted : Monday, November 24, 2014 7:39:26 PM(UTC)
jovanni

Rank: Member

Groups: Registered
Joined: 10/29/2014(UTC)
Posts: 12
Italy
Location: Schio

Hi,
on the Model property "SQL Statement" "<Expand to view SQL>" the Select is correct without Where 1 = 0
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.