Solved

This is an interbase question!

Posted on 2001-08-30
2
321 Views
Last Modified: 2008-03-10
I run the following query in interbase 5.5:

select h.socialsecuritynumber,h.lastname,
h.firstname,s.underggradcollege,h.homecity,h.homestatecode,
(select min(termid) from coursetaker where studentid=h.humanid) startterm
from coursetaker c,human h,student s
where
c.studentid=h.humanid
and
h.humanid=s.belongstohumanid
and
c.termid between 10009 and 10106
order by h.lastname,h.firstname

It works ok, but one thing. I want non-duplicate records. I put distinct after select and before all the fields and it gives an error:

General SQL error.
Invalid request BLR at offset 215
context already in use (BLR error).

Does anybody know how can I run the above query for distinct records?
Thank you.
0
Comment
Question by:sigalos
2 Comments
 

Accepted Solution

by:
AndreDicks earned 75 total points
Comment Utility
I think that if you use 'group by ' for all your fields you ought to be alright.

Regards
Andre
0
 

Author Comment

by:sigalos
Comment Utility
You are right. I did found the answer already by using group by and distinct at the same time.
Then, I wanted to do something more:

select h.socialsecuritynumber,h.lastname,
h.firstname,s.underggradcollege,h.homecity,h.homestatecode,
(select termcode from term where termid in
(select min(termid) from coursetaker where studentid=h.humanid)) startterm
from coursetaker c,human h,student s
where
c.studentid=h.humanid
and
h.humanid=s.belongstohumanid
and
c.termid between 10009 and 10106
order by h.lastname,h.firstname

and this one runs forever.

You have the points, but I was just wondering if you have a suggestion there too. You have been of great help...

Thank you.
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now