Hi,
I created a view with table1, table1 contains these fields:
Table1RecId-- aggregation(Min)
JournalParmId -- i added this to the GroupBy node
JournalType
I also have range with Posted =1
This resulted in this query
SELECT MIN(RECID) AS TABLE1RECID, JOURNALPARMID, JOURNALTYPE, DATAAREAID, PARTITION, 1010 AS RECID
FROM dbo.TABLE1 AS T1
WHERE (POSTED = 1)
GROUP BY JOURNALPARMID, JOURNALTYPE, DATAAREAID, PARTITION
However, i want to use count(*) with this condition having count(*) <2, how can i amend the view to get this result?
SELECT MIN(RECID) AS TABLE1RECID, JOURNALPARMID, JOURNALTYPE, count(*), DATAAREAID, PARTITION, 1010 AS RECID
FROM dbo.TABLE1 AS T1
WHERE (POSTED = 1)
GROUP BY JOURNALPARMID, JOURNALTYPE, DATAAREAID, PARTITION
having count(*)<2