Hi everybody,
With Plex I want to make a "DISTINCT" in my view like in sql server. I was looking in the "CA PLEX HELP" and I Found this:
VW DBMS script SRC
So, I create a source code with this instruction:
-- END OF THE VIEW
#END
-- SELECT DISTINCT OF THE VIEW
#BEGIN
SELECT distinct * FROM [Nomina].[dbo].[AA1pV]
And Include this SRC in the triple of the view like in the picture below:
I compiled & Generated the view and the function which is pointing to that view.
The view retrieve all the data, and the 'distinct has not effect.
How could achieve to do a distinct in plex?
thanks.
P.D: This is the source code of my view that is generated using plex:
#BEGIN VIEW AA1pV
CREATE VIEW AA1pV AS
SELECT
T1.ReferenciaEntrada,
T1.EstadoTransaccion
FROM Aviso_Entrada T1
-- END OF THE VIEW
#END
-- SELECT DISTINCT OF THE VIEW
#BEGIN
SELECT distinct * FROM [Nomina].[dbo].[AA1pV]
#END
Thanks GeorgeJeffcock.
This syntax is the correct for my solution, I must put two #BEGIN... One to verify the existence of the view and other that create the view because
if i put all into one #begin, it displays an error...
-- END OF THE VIEW
#END
#BEGIN
IF ( OBJECT_ID('%N') IS NOT NULL )
DROP VIEW %N
#END
#BEGIN
CREATE VIEW %N AS
SELECT DISTINCT
T1.ReferenciaEntrada,
T1.EstadoTransaccion
FROM Aviso_Entrada T1