473,503 Members | 2,076 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Sql server Query, having count(*)>1 and order by count(*) desc

229 New Member
Hi, I have this query to get a drop down list and that works fine. The trouble is I need to select another field from the table to give it a where clause but if I try I get an error message.

Expand|Select|Wrap|Line Numbers
  1. SQLQuery = "select tbl.country from tbl group by country HAVING COUNT(country) > 1 order by count(country) desc"
Any pointers would be great
Thanks
Richard
Apr 2 '14 #1
1 2248
Rabbit
12,516 Recognized Expert Moderator MVP
I don't see a where clause or the error message.
Apr 2 '14 #2

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

Similar topics

2
2478
by: vidya | last post by:
Hi, I wrote a stored procdure in SQL Server which calculates some metrics. This procedure always returns only one row with 11 columns of integer values. I ran it in SQL Server Query Analyzer...
9
3736
by: Steve Jorgensen | last post by:
Hi all, Frankly, this is such an off-beat thing, I don't know if anyone else here will ever have the same issue. Just in case anyone does, though... I needed to be able to search for the...
2
1340
by: Jorge Varona | last post by:
Greetings, I am having a difficult time trying to get my index server query to work. Here's the code: // create a connection object and command object, to connect the Index Server ...
1
3660
by: sunilkeswani | last post by:
Hi I am still new to access. I want to know how i can build a query which can display results from 4 different columns/fields Like. Field1 Field2 Field3 Field4 1 2 1 ...
0
6027
by: samui | last post by:
Syntax is ORDER BY column_name ASC|DESC, so your statement: $res = mysql_query("SELECT * FROM EWT WHERE $field='$findit' ORDER BY $orderby DESC;") Ronald :cool:
1
2355
by: wintonsl | last post by:
Would anyone know how to convert this Access Query to SQL Server Query? Format(((+++)/(IIf(>0,1,0)+IIf(>0,1,0)+IIf(>0,1,0)+IIf(>0,1,0))),"Standard") What this query is doing in Access is...
4
4146
by: winniewang | last post by:
Hi everyone, Who can help me to translate the SQL Server query to DB2 query? The query were shown as below: CAST( CONVERT( CHAR(2), MonthNumberOfYear) + '/ ' + '1/' + CalendarYear AS...
3
9039
by: Kunal Desale | last post by:
Hello, I am migrating access queries to SQL Server 2005 Queries. My Access Query Is: SELECT qtrade.intordreftrim AS Expr1, qtrade.extordreftrim AS Expr2, qtrade.intinvreftrim AS Expr3,...
8
3684
by: munkee | last post by:
Hi people, Im struggling with this quite hard to explain database query. How would I count only once the (many) occurance of a record within a one to many relationship. I have the following...
0
7188
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
7063
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7313
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...
1
4987
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4663
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3156
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1489
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
720
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
366
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.