]> andersk Git - moira.git/commitdiff
Initial revision
authormar <mar>
Mon, 12 Sep 1988 17:39:45 +0000 (17:39 +0000)
committermar <mar>
Mon, 12 Sep 1988 17:39:45 +0000 (17:39 +0000)
db/class.qc [new file with mode: 0644]

diff --git a/db/class.qc b/db/class.qc
new file mode 100644 (file)
index 0000000..ad0d81d
--- /dev/null
@@ -0,0 +1,35 @@
+/* $Header$
+ *
+ *  Counts how many member of each class exist in the database.
+ *
+ *  (c) Copyright 1988 by the Massachusetts Institute of Technology.
+ *  For copying and distribution information, please see the file
+ *  <mit-copyright.h>.
+ */
+
+#include <mit-copyright.h>
+#include <sms.h>
+
+
+main()
+{
+##  char class[9], *c;
+##  int n;
+    struct save_queue *sq, *sq_create();
+
+    sq = sq_create();
+
+##  ingres sms
+
+##  range of u is users
+##  retrieve unique (class = trim(u.mit_year)) {
+       sq_save_data(sq, strsave(class));
+##  }
+
+    while (sq_get_data(sq, &c)) {
+##     repeat retrieve (n = count(u.login where u.mit_year = @c))
+       printf("%8s: %4d\n", c, n);
+    }
+
+##  exit
+}
This page took 0.079888 seconds and 5 git commands to generate.