473,385 Members | 1,769 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

doubt in query

hi friends.

i had to execute this query,but it post a error saying"its not a group function"

The query is "select name,count(trainingdates) from tablenames group by having count(trainingdates)<=5 and tablename.trainerid=tablename.trainerid

i need to compare the count function and join query using where clause,can any body help me please
Nov 3 '08 #1
2 1535
Pilgrim333
127 100+
Hi,

Your query should be:

Expand|Select|Wrap|Line Numbers
  1. select name,count(trainingdates) 
  2. from   tablenames 
  3. group by name having count(trainingdates)<=5 and   
  4.                      tablename.trainerid=tablename.trainerid
  5.  
Your output contains the column name, and a count. Name should be in your group by clause.

Pilgrim.
Nov 3 '08 #2
debasisdas
8,127 Expert 4TB
as suggested in the previous post you need a field to group by ,which is missing in your query.
Nov 3 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: RK | last post by:
Hi, In my application, I need to copy data from an Excel file into a SQL table. The article related to this can be found at http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B306572 ...
1
by: maridu h.s.n.v.prasad | last post by:
subscribe end hai sir i am using the postgresql 7.2 my doubt is what is the command of to see the list of databases i create a database named "jntuoes" database created it's displayed but i...
11
by: Bob Nelson | last post by:
I don't remember seeing the term ``doubt'' used much in c.l.c. back in the 90's. When did this word become nearly synonymous with ``question'' or ``query'' and does it have static duration?
1
by: Prabhua | last post by:
Can anybody clear my doubt in sql query. i want to display distinct company from the database where status is not empty. here company and status are columes. a.prabhu
4
by: SandyIsCool | last post by:
Hi, I am newbie to asp.net. I have small doubt regarding page life cycle. MSDN documentaion says that init event does blhah, blah load event does blah blah etc. But Id ont see any init or load...
6
by: abctech | last post by:
My requirement is such that any user must not be allowed to save the same record twice. For this what I do is as soon as some user fills up the page and clicks 'Save' I invoke a Servlet which...
4
by: pradeep kaltari | last post by:
Hello friends, I have a doubt in the working of IN operator. I have a schema by name 'test_schema'. If you look at the following query the expected output is "1", but nothing is displayed. SELECT...
7
rsrinivasan
by: rsrinivasan | last post by:
Hi, Good Morning To All.. I have doubt in my query.. My Query is, select * from table1,table2, table3.. where table1.field=table2.field and...
0
by: ssknov | last post by:
hi all i have a doubt, that when i have several "select" queries for different tables, different criterias in same table, SHOULD I USE seperate DATASETS for each query? pls reply me. since i...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.