473,473 Members | 2,166 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Help needed with a complex query

DH
Hi. I'm not a SQL power user but can handle most simple queries. But I have
no idea how to approach this problem...hopefully someone can point me in the
right direction.

I have a table which lists point numbers, bird species that was seen at each
point, and the number of birds seen. So, if I saw 5 different kinds of birds
at point #1, then there are 5 rows with '1' in the Point column and the bird
name in the 'Species' column, and a 3rd column listing the number of that
bird seen.

I then do a select query, using a WHERE statement to filter for the bird I
want to view. The end result of the query is a table that lists points, bird
(that match the where statement), and number of birds. No problem. This
works fine.

Here is the part I don't know how to handle. If I have 10 points (1-10) but
the birds I'm searching for (via the WHERE) are only seen on points 3 and 4,
I only get points '3' and '4' in the result. The number of points and how
they are labeled vary (ie. some are 1,2,2a,3,3a... and others are
1,2,3,4...). So, in the case that there is a match only on points '3' and
'4', I want the resulting table to list ALL of the points with '0' as the
number of birds.

In short, I want to return a row with a '0' in the number of birds column
for rows that do not match the WHERE statement. And I only want 1 of there
rows per point...not 1 for every bird that doesn't match the WHERE clause.

Hopefully that makes sense. Let me know if it doesn't.

Thanks

Nov 12 '05 #1
0 1418

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Ryan | last post by:
We have an MIS system which has approx 100 reports. Each of these reports can take up to several minutes to run due to the complexity of the queries (hundreds of lines each in most cases). Each...
4
by: Christoph Bisping | last post by:
Hello! I'm seeking advice on a rather complex type of query I need to build in an Access ADP (SQL-Server 7). There are four tables: tblPeople ID(PK) PRENAME --------------- 1 Thomas 2 Frank
1
by: Eva | last post by:
Hi, Im new to Vb.net and am trying to create my first practice project. The problem iv encountered is to do with SQL queries issued against my Access DB iv created. i want to wright a query...
5
by: - | last post by:
Hello to all I need help on some sql statements and wondering is anyone out there is able to help. I've extracted some data from the database into a new table consisting of 4 fields CustomerID...
1
by: steven.fafel | last post by:
I have been working with SQL for a while...but I am stumped. I can not seem to get my arms around this query....can anyone help... Here it is: Table = 12 rows, 4 columns (id, name, amount,...
2
by: Jayjay | last post by:
When it comes to access, I'm pretty good using the built in features and can come up with some pretty complex functions to get what I need. But we have this database I'm doing for work that is...
4
by: Koen | last post by:
Hi all, At work I created a database which is really helpful. The database is used by approx 15 users. Everything worked great, until I added some 'scoreboard' forms and reports. I get the...
8
by: babyangel43 | last post by:
Hello, I have a query set up in Access. I run it monthly, changing "date of test". I would like this query to be merged with a Word document so that the cover letter is created in Word, the fields...
4
verbatim
by: verbatim | last post by:
i have 4 tables in a db, to allow users rate certain recipes. they might not rate all recipes at one time. they might even go back and rate a recipe more than one time. there will also be at least 1,...
0
crystal2005
by: crystal2005 | last post by:
Hi, I am having trouble with some complex SQL queries. I’ve got winestore database, taken from Web Database Application with PHP and MySQL book. And some question about queries as the following ...
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
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
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
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
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
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.