Generate query

Posts   
 
    
Noer
User
Posts: 33
Joined: 04-Jan-2007
# Posted on: 24-Jun-2008 13:36:44   

How do I end up with this query

select distinct navn, (select top 1 drugid from dbo.Prod_GrundData_Laegemiddel x where x.navn = Prod_GrundData_Laegemiddel.navn) drugid
from dbo.Prod_GrundData_Laegemiddel
where navn like 'panodil%'

I'm using V 2.5 SelfServicing

Walaa avatar
Walaa
Support Team
Posts: 14994
Joined: 21-Aug-2005
# Posted on: 25-Jun-2008 10:53:51   

Please check the Scalar query expressions section in the docs. At the following path: Using the generated code -> Field expressions and aggregates -> Expressions

P.S. There is a code example there.

Noer
User
Posts: 33
Joined: 04-Jan-2007
# Posted on: 25-Jun-2008 10:57:06   

Thanks simple_smile