VishalMistry
21st January 2010, 09:57
Hi all Tools gurus,

Is there any way to select distinct values in ERPLn select statement. I am unable to use Distinct keyword in SQL statement.

Vishal

george7a
21st January 2010, 10:18
Check the LN manual. Here is quote from mine:
SELECT clause
The SELECT clause specifies a table that is the result of applying the expressions in it to the input table. The input table may be a grouped table, but the result table is never a grouped table. The SELECT clause specifies which columns must be selected and which functions must be applied to the columns. It operates on the table that is the result of the FROM clause, after applying the optional WHERE clause, the optional GROUP BY clause and the optional HAVING clause.

Syntax

<select clause>
::= SELECT [<set quantifier>] [FOR UPDATE] <select list>

<set quantifier>
::= DISTINCT | ALL

<select list>
::= *
| <select item> {, <select item> }...

<select item>
::= <qualifier>.*
| <value expression> [ [AS] <alias name>]
| <array column reference> [ [AS] <alias name>]

<array column reference>
::= <column reference>

<qualifier>
::= <table name>
| <correlation name>

<table name>
::= !! a valid table name

<correlation name>
::= <identifier>

<alias name>
::= <identifier>

Here are some other search results:
http://www.baanboard.com/baanboard/showthread.php?t=10073
http://www.baanboard.com/baanboard/showthread.php?t=9719
http://www.baanboard.com/baanboard/showthread.php?t=56785
http://www.baanboard.com/baanboard/showthread.php?t=51980
http://www.baanboard.com/baanboard/showthread.php?t=6736

Please search the forum for more information,

- George

VishalMistry
23rd January 2010, 07:58
Hi Mr. George,

U R Right. I am able to use the DISTINCT keyword.

Thanks a lot.
Vishal

MilindV
25th January 2010, 07:08
Hi Vishal,

I tried using "DISTINCT" keyword some time back, but I didn't get desire result.

Will you post your code, or sample code for reference?

Thanks & Regards
Milind Vengurlekar

VishalMistry
27th January 2010, 09:03
Hi Mr.Milind,

select distinct tfcmg103.btno, tfcmg103.ptbp
from tfcmg103
where tfcmg103.btno = :btno.f
selectdo
tmp.bpid = tfcmg103.ptbp
tmp.btno = tfcmg103.btno
create.payment.advice.file()
send.mail()
message("Payment advice generated and emailed.")
endselect


Regards,
Vishal