I need to now the unique elements of the column: DESCORREOAF from Recipients table.
I used this query:
SELECT COUNT(DISTINCT DESCORREOAF) AS DESCORREOAF FROM NmsRecipients;
But is giving error:
27/09/2023 17:28:54 PGS-220000 PostgreSQL error: ERROR: relation "nmsrecipients" does not exist LINE 1: ...T COUNT(DISTINCT DESCORREOAF) AS DESCORREOAF FROM NmsRecipie... ^ .
The column I need to query is this in XML: <attribute name="DESCORREOAF" type="string"/>
Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
Hi @god_prophet ,
As your data type is string, you need to give 's' in prefix of the attribute name while running the SQL code.
Please try the below SQL code and execute it - it will work!
SELECT COUNT(DISTINCT sDESCORREOAF) AS DESCORREOAF FROM NmsRecipients;
Thanks,
Sanchari
Hello @god_prophet
If you are doing some testing and want to know the numbers, You can use the distribution of values functionality.
You can use the query activity, add the column, and click the " don't he highlighted " icon. It will give you the count and distinct values.
If you want these records in a workflow, then you can do this
Hi @god_prophet ,
As your data type is string, you need to give 's' in prefix of the attribute name while running the SQL code.
Please try the below SQL code and execute it - it will work!
SELECT COUNT(DISTINCT sDESCORREOAF) AS DESCORREOAF FROM NmsRecipients;
Thanks,
Sanchari
Hi @god_prophet ,
Please check the values of SQL Table name with name "sqltable" and also the SQL Column name "sqlname" from the Preview Tab of Data Schema and try running the SQL Code .
In your Example, the SQL Code can be as shown below:
SELECT COUNT(DISTINCT {sqlname to be checked in Preview Tab in Recipient Schema}) AS DESCORREOAF FROM NmsRecipient;
Regards,
Pravallika.
Views
Replies
Total Likes