和sql就是一样啊。。
String hql = "select distinct filedName from Table";

解决方案 »

  1.   

    select distinct M from table M
      

  2.   

    我改成这样了:
    Session session = HibernateSessionFactory.currentSession();
    Transaction tx = session.beginTransaction();
    String sql = "select distinct C610000008,C610000009 from SysSkillpo";
    List l_result = session.find(sql);
    tx.commit();
    HibernateSessionFactory.closeSession();
    return l_result;在执行时出现这个异常:
    java.lang.NullPointerException
    at cn.com.ultrapower.eoms.user.authorization.role.hibernate.dbmanage.GetRole.main(GetRole.java:118)
    不知为什么?
      

  3.   

    关注,我也有个调用distinct的程序,总是抛出java.lang.NullPointerException