本文介绍了绑定下拉列表的查询问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

先生,您好,先生,我目前正在开展宿舍管理项目,当我从数据库的下拉列表中向学生分配仅vacent房间的空间时,我可以显示分配了多少空间,vacent是多少空间,我们如何可以做

hello sir currently i am working on hostel management project i want when i allot room to the sutdent only vacent room are show in dropdownlist from database and i can show how much room are alloted and how much are room are vacent ,how we can do

推荐答案


select * from TableName where IsVacant=0



此查询仅返回空房间列表..

您也可以使用group by子句进行计数
就是这样.. :)



this query returns list of vacant room only..

You can count also with group by clause
like that.. :)

select count(*) from TableName group by IsVacant



它可以为您分配空置房间的数量



It gives you count of alloted as well Vacant rooms


这篇关于绑定下拉列表的查询问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-24 20:07