问题不明确呀,什么意思??
组是怎么分的,和系有关系吗//
可以这样了
select * from students where gruop_id like(
select min(gruop_id) as min_id form
(select * from students where 院系名称 like '化学系'))
应该行,不过我也没试过,思路应该可以,
可能效率低
组是怎么分的,和系有关系吗//
可以这样了
select * from students where gruop_id like(
select min(gruop_id) as min_id form
(select * from students where 院系名称 like '化学系'))
应该行,不过我也没试过,思路应该可以,
可能效率低
解决方案 »
- 请问延时15分钟应该怎么做?
- 怎样读取所有驱动器到一组checkbox中?
- 这段连接代码为什么是这样的而不是我想的那样的,请细解释下(散分,解释的来)
- 请问要实现按ctrl+F 弹出新窗口 怎么实现?
- ***使用QReport,在ColumnHeader中不能显示QRLabel是什么原因?当场给分!***
- 谁能帮我讲讲Vcl的消息机制
- Tchart的曲线要想从实线换成虚线,怎么做?
- 有谁能够给个可以播放dvd的dll给我用pb调用?
- 谁知道DELPHI的数据库为什么总出问题。(存图片用什么类型的字段)存到二三十MB就出问题,是不是它有一定的量就不能存了。
- 各位大虾,在delphi中如何制作像ie地址栏旁的"转到"那样
- 请问如何才能给你们分?
- 高手们,能不能给我这样的一个例子?
select * from student where Group_ID =
(select min(Group_ID) from student where Group_ID between 34 and 48);
2.
select * from student where Group_ID =
(select min(Group_ID) from student where Group_ID between 34 and 48
and Group_ID not in (select min(Group_ID) from student where Group_ID between 34 and 48));
包括若干组,每个组内有若干个学生。但是每个系内的组号不是从1往上排
也就是可能是这种情况:物理系1-9组,化学系10-23组,生物系24-31组..
现在查询条件包括:知道了系名,又知道了要选择的组是这个系中的第几组
(按A组B组C组D组E组F组...排列),要查出这一组学生的信息。
to zhuzhichao(竹之草):34-48使我假设的,实际操作中这个数可能是随机的呀,呵呵。
Query1.Sql.Clear;
sqlstr:='select min(Group_ID) from students where 院=化学学院';
Query1.Sql.Add(sqlstr);
Query1.Open();
GroupNum:=Query1.fieldbyname('Group_ID').asinteger; Query1.Sql.Clear;
sqlstr:='select Group_Order,姓名'+ComboBox3.Text+' from students where Group_ID='+inttostr(GroupNum);
Query1.Sql.Add(sqlstr);
Query1.Open();执行后错误提示为‘Table is read only’,可写这几句话之前没有类似错误呀。
sqlstr:='select min(Group_ID) from students where 院=化学学院';
Query1.Sql.Add(sqlstr);
Query1.Open();
GroupNum:=Query1.fieldbyname('Group_ID').asinteger; Query1.Close; //需要增加Close
Query1.Sql.Clear;
sqlstr:='select Group_Order,姓名'+ComboBox3.Text+' from students where Group_ID='+inttostr(GroupNum);
Query1.Sql.Add(sqlstr);
Query1.Open();
用单步执行发现后面那段没问题,
还是sqlstr:='select min(Group_ID) from students where 院=化学学院';这句后面一Open就报错。
请问min的用法对不对?
query1.close;
Query1.Sql.Clear;
sqlstr:='select min(Group_ID) from students where 院=化学学院';
Query1.Sql.Add(sqlstr);
Query1.Open();
GroupNum:=Query1.fieldbyname('Group_ID').asinteger;
这样就应该行了吧
如果后面的没错的话
query1.Sql.Clear;
sqlstr:='select min(Group_ID) from students where 院=化学学院';
Query1.Sql.Add(sqlstr);
Query1.Open();
GroupNum:=Query1.fieldbyname('Group_ID').asinteger;