数据库查询select o.extra_id,s.School_ID,s.School_Name,s.Country,o.first_name,o.last_name from orders_extra_info o left join schools_master s on o.organisation_name=s.School_Name order by o.extra_id descSchool ID School Name School Country Student First Name Student Last Name
Pending Schools Pending Schools Pending Schools xxx xxxx
2 mocheng middle school China xxxx xxxx
Pending Schools Pending Schools Pending Schools xxxx xxxx
Pending Schools Pending Schools Pending Schools xxxx xxxx
Pending Schools Pending Schools Pending Schools chen xxxx
Pending Schools Pending Schools Pending Schools xxxx xxxx
得出这么多查询集合,
正常情况是这么排序,,然后界面中还有2个select选择框,一个是各学校的名字,一个是国家然后问题是,,select选择要过滤排序,排序的要求是 先按 School Name 后按 School Country排序,
比如select选择 school name为mocheng middle school,那么记录中只显示一条记录,其余5条过滤掉,,好像很难啊
Pending Schools Pending Schools Pending Schools xxx xxxx
2 mocheng middle school China xxxx xxxx
Pending Schools Pending Schools Pending Schools xxxx xxxx
Pending Schools Pending Schools Pending Schools xxxx xxxx
Pending Schools Pending Schools Pending Schools chen xxxx
Pending Schools Pending Schools Pending Schools xxxx xxxx
得出这么多查询集合,
正常情况是这么排序,,然后界面中还有2个select选择框,一个是各学校的名字,一个是国家然后问题是,,select选择要过滤排序,排序的要求是 先按 School Name 后按 School Country排序,
比如select选择 school name为mocheng middle school,那么记录中只显示一条记录,其余5条过滤掉,,好像很难啊
解决方案 »
- MySQL Connector/Net 5.1.3 客户端读读出来的数据都是乱码,试尽了一下方法都无法解决,那位大虾可以帮忙??
- 数据库中一个字段存了两个部分的id,以逗号分割,在查询时候怎么能显示名称
- 求一个sql语句(千万级别)
- 大表换分区是否所有记录需要重新 在插入一遍?
- 急!! 求救 !! 请高手指点,谢谢!
- 本人用C写了一个操作mysql数据库的程序,发现在对mysql进行高频繁的查找、插入数据时,会出现“mysql lost connection”、“……gone awa
- mysql5.0(unzip版)如何安装配置?
- MySQL中,怎么样模糊查询效率最高?
- 无法恢复带图片的MYSQL数据库
- You have an error in your SQL syntax; check the manual that corresponds to your
- 谁知道怎样判断表里面有没这条数据,如果没就添加有就更新
- mysql数据表统计
null ——————————— null ——————-----null
2------------------------mocheng middle school-----China
null ——————————— null ——————-----null
null ——————————— null ——————-----null
null ——————————— null ——————-----null
这样看的清晰点
居然有这种错误,select count(*) 难道不能查询 集合 ???完了,没人搭理了,锋芒太露也不好啊,,换马甲了要
再运行的时候,,运行到select count(*) as total from 这条sql语句的时候报错。。报错提示2楼
select * from (
select o.extra_id,s.School_ID,s.School_Name,s.Country,o.first_name,o.last_name from orders_extra_info o left join schools_master s on o.organisation_name=s.School_Name order by o.extra_id desc)
)换个角度说,运行这句话报错,,谁能解释一下错在何处
SELECT * FROM (
SELECT o.extra_id,s.School_ID,s.School_Name,s.Country,o.first_name,o.last_name FROM orders_extra_info o LEFT JOIN schools_master s ON o.organisation_name=s.School_Name ORDER BY o.extra_id DESC) a
) b
select * from (
select o.extra_id,s.School_ID,s.School_Name,s.Country,o.first_name,o.last_name from orders_extra_info o left join schools_master s on o.organisation_name=s.School_Name order by o.extra_id desc) t1
) t2提问时一定要提问完整的信息,否则别人根本无法准确判断你的问题。 比如你把你相关的表的show ceate table 也贴出的话,别人就可以直接进行测试以确保回复你的语句的正确性。没有你表的信息,则只能手工看个大概。问题说明越详细,回答也会越准确!参见如何提问。(提问的智慧)