Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
3
Erster Beitrag:
vor 1 Woche
Letzter Beitrag:
vor 1 Woche
Beteiligte Autoren:
Erik Schwarz, Fabrice Harari, R.R.Siva Sangavi

[WD 21], Subquery with union(s) for report

Startbeitrag von R.R.Siva Sangavi am 20.03.2017 12:51

Need to create a query file which consist of subquery like below,

Select Column_Name1,Sum(Total) as Total,Sum(Quantity) as Quantity
From
(Select Column_Name1,Count(Column_Name2) as Total,0 as Quantity
From Table_Name1
Group by Column_Name1

union all

Select Column_Name1,0 as Total,Count(Column_Name2) as Quantity
From Table_Name2
Group by Column_Name1)

Group by Column_Name1
having sum(Total) > 0

This query runs successfully in HFSQL control center. When i try to create in windev Query Editor is not allowing to create it.

How to do it Please help me.

I want to create a report based on this query.

Regards,
R.R.Siva Sangavi

Antworten:

Hi

that may not be possible... I'm not sure the query editor supports subqueries like that.

The good news is that it's not mandatory to do so. You can just store your query in a string and execute it instead of using the query editor...

Best regards

von Fabrice Harari - am 20.03.2017 13:12
Hi,

and you can do that directly in the code or with the query Editor -> select 'SQL code' as the type of query.

Best regards

Erik

von Erik Schwarz - am 20.03.2017 15:02
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.