debugx wrote:
Hello, All.
I use Inner Join operator in my sql query:
Code:
IQuery queryForRolls = session.CreateQuery(string.Format("select RollId from Rolls as RollId inner join RollOnReels on Rolls.Roll_ID = RollOnReels.Roll_ID and RollOnReels.Reel_ID = {0}", ReelId));
rolls = queryForRolls.List();
But some exception is appeared:
NHibernate.QueryException : unexpected token: inner
How can I resolve this problem?
Hibernate version:1.0.2.0
You can try something lik this :
IQuery queryForRolls = session.CreateQuery(string.Format("select RollId.columName from Rolls as RollId inner join RollOnReels on RollId.Roll_ID = RollOnReels.Roll_ID and RollOnReels.Reel_ID = {0}", ReelId));
rolls = queryForRolls.List();
Since you have already created an alias for Rolls , i.e,RollId , try referring to the column names using this alias..e.g, RollId.columName