• Post Reply Bookmark Topic Watch Topic
  • New Topic

quey with alias name not working

 
mano ranjan
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
my query is "select c.order_id as ID from customer_seller_orders c";
this is my query in which iam using session.createSQLQuery(...) to exceute this query . iam getting syntax exception.can anybody tell me how to use alias name in columns of a table..

thanks
mano
 
Pavel Cherkashin
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The best way to make clear, your sql is correct - is to run it in SQL console (PL SQL Developer or native oracle console). The SQL query you provided look correct. Here can be another trick - you might point to inexistent table, column. The other trick can be in hibernate result mapping. Refer Hibernate SQL Queries manual to see how is correct.
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!