Path: utzoo!utgpu!water!watmath!clyde!rutgers!im4u!ut-sally!ut-emx!lad-shrike!chris From: chris@AUSTIN.LOCKHEED.COM (Chris Wood) Newsgroups: comp.databases Subject: Re: Informix query Summary: SQL limitations Message-ID: <71@coot.AUSTIN.LOCKHEED.COM> Date: 12 Jan 88 14:03:49 GMT References: <3072@ihlpf.ATT.COM> <3890001@hpcmmb.HP.COM> <3216@ihlpf.ATT.COM> <29265UH2@PSUVM> Organization: Lockheed Austin Div. Lines: 36 Posted: Tue Jan 12 08:03:49 1988 In article <29265UH2@PSUVM>, UH2@PSUVM.BITNET (Lee Sailer) writes: > I've never used any SQL product, but supposedly know some of the underlying > ideas. How about something like > > good customers = Select count(id#) > FROM customers > WHERE area = NORTHEAST and qty.ordered > 1000 > > > > For the total orders problem, try something like > > SELECT number, sum(amount) > FROM customers, orders > WHERE custno = number > GROUP BY number > > and define customers.totalamt = SELECT tamt FROM t > WHERE customers.number=t.number > All of this is fairly close, but the point is that I could do it in 1 query with M204, but a single query in SQL can only do a single thing. This means that if I want to do several things to the same set of records, I must re-retrieve those records for each function. I guess this kind of grates against the "traditional" programmer in me that still yearns for a modicum of efficiency. It is obviously simpler to do one thing at a time, but it bothers me to repeat work. Once I have located and retrieved a set of data, I really don't want to have to do it all over again just because the query language forces me into it! I am now convinced that this is not a problem with "relational", it is a problem with SQL. Question: I am (embarassingly) unfamiliar with CURSORS. Will they solve some of this problem? Chris Wood