Jump to content
Changes to the Jaspersoft community edition download ×

Field name of a count(*) column ?

2004 IR Help

Recommended Posts

By: Ombre - ombre

Field name of a count(*) column ?

2005-11-18 15:22


I'm using a query like "select count(*),name from table ..." and i'm trying to get the field corresponding to count(*)....



PS : In my case, a normal "select * from table" using a sum (in order to replace the count(*)) won't fit because i've got thousands of lines in my database and i fear it will take a "long" time to fill my report.





By: Denny Valliant - xenden

RE: Field name of a count(*) column ?

2005-11-18 15:37

try "select count(*) AS thecount,name FROM table" so you know the name.

Otherwise it depends on the RDBMS I suppose (what database you use). So look at the DB docs to see what names it assigns it's calculated columns, if you can't name the column for some reason.

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...