• stoler (5/15/2009)


    I thought about this, but problem is - I have more fields - and for every filds I must prepare subquery.

    In MSAcces there is group function FIRST and the solution may be

    select group, first(subgroup), ....

    from table

    group by group

    I don't know anything about such function in sqlserver

    Second solution is to make join, but it need join

    select t1.group, t2. subgroup

    from table t1 inner join table t2 on t1.group = t2.group

    order by t2.subgroup

    but in this solution I want to get join 1 -1 not 1 to many

    There's no First() function in SQL because it's meaningless in a relational database. There's no inherent row-order in a relational table, so "first()" is useless.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon