Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

This is an interbase question!

Posted on 2001-08-30
2
Medium Priority
?
330 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 

Accepted Solution

by:
AndreDicks earned 150 total points
ID: 6444122
I think that if you use 'group by ' for all your fields you ought to be alright.

Regards
Andre
0
 

Author Comment

by:sigalos
ID: 6445317
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

598 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