第一个页面
<html>
<body>
<a href="q.html">A</a>
</body>
</html>下面要求写出q.html的页面,该页面按首写字母能提取数据库中的信息!!具体要实现在前一个页面点击大写字母 A 得到书库中的一大写字母A为开头数据库信息!前提是我数据库中的信息已经固定了,有300多条!(请不要告诉我在数据库中设置A的字段)懂的高手帮我个忙,请写出写出完整的页面!谢谢!!

解决方案 »

  1.   

    select * from tb where col like 'A%'
    这样吗
      

  2.   

    那就得 新建个字段  通过 sqlserver自定义函数 把每个 要查询的数据项 生成拼音 然后通过字母查询这个拼音
      

  3.   

    加群:2346621 一起交流,一起学习Spring ,Hibernate, Struts. Flex 等编程语言及数据库知识..我们只接收对编程感兴趣,有上进心的人.
    我们都是年轻人,我们都对编程感兴趣.
    我都有上进心,我们要进步,我们要充实自己.
    因为我们年轻,所以我们都有资本.
      

  4.   

    LZ想用哪种语言获取这个参数呢?JS?JSP?ASP?。
      

  5.   


    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    <title></title>
    <link href="css/style.css" rel="stylesheet" type="text/css" />
    <!--   引入jQuery -->
    <script src="../scripts/jquery-1.3.1.js" type="text/javascript"></script>
    <script type="text/javascript">
      $(function(){
           $("#filterName").keyup(function(){
          $("table tbody tr")
    .hide()
    .filter(":contains('"+( $(this).val() )+"')")
    .show();
       }).keyup();
      })
    </script>
    </head>
    <body>
    <div>
    <br/>
    筛选:
    <input id="filterName" />
    <br/></div><table>
    <thead>
    <tr><th>姓名</th><th>性别</th><th>暂住地</th></tr>
    </thead>
    <tbody>
    <tr><td>张山</td><td>男</td><td>浙江宁波</td></tr>
    <tr><td>李四</td><td>女</td><td>浙江杭州</td></tr>
    <tr><td>王五</td><td>男</td><td>湖南长沙</td></tr>
    <tr><td>找六</td><td>男</td><td>浙江温州</td></tr>
    <tr><td>Rain</td><td>男</td><td>浙江杭州</td></tr>
    <tr><td>MAXMAN</td><td>女</td><td>浙江杭州</td></tr>
    <tr><td>王六</td><td>男</td><td>浙江杭州</td></tr>
    <tr><td>李字</td><td>女</td><td>浙江杭州</td></tr>
    <tr><td>李四</td><td>男</td><td>湖南长沙</td></tr>
    </tbody>
    </table></body>
    </html>在jquery中有个contains这个方法来过滤
      

  6.   

    给你为A的按钮赋值为A 点击后把值传到sql语句 迷糊查询a字母开头的,如果数据库是汉字 就需要把汉字转换成拼音
      

  7.   

    html页面可以得到传过来的字母A,然后执行SQL,select * from tabName where functionName(colName) like 'A%'     其中functionName就是你用来把汉字转换成拼音的数据库里的函数。 不知这样说是否明白
      

  8.   

    有点不明白啊,数据库里的函数是不是这个:function   TForm1.GetPY(hzchar:string):char; 
    begin 
        case   WORD(hzchar[1])shl(8)+WORD(hzchar[2])   of 
            $B0A1..$B0C4   :   result:= 'A '; 
            $B0C5..$B2C0   :   result:= 'B '; 
            $B2C1..$B4ED   :   result:= 'C '; 
            $B4EE..$B6E9   :   result:= 'D '; 
            $B6EA..$B7A1   :   result:= 'E '; 
            $B7A2..$B8C0   :   result:= 'F '; 
            $B9C1..$B9FD   :   result:= 'G '; 
            $B9FE..$BBF6   :   result:= 'H '; 
            $BBF7..$BFA5   :   result:= 'J '; 
            $BFA6..$C0AB   :   result:= 'K '; 
            $C0AC..$C2E7   :   result:= 'L '; 
            $C2E8..$C4C2   :   result:= 'M '; 
            $C4C3..$C5B5   :   result:= 'N '; 
            $C5B6..$C5BD   :   result:= 'O '; 
            $C5BE..$C6D9   :   result:= 'P '; 
            $C6DA..$C8BA   :   result:= 'Q '; 
            $C8BB..$C8F5   :   result:= 'R '; 
            $C8F6..$CBF9   :   result:= 'S '; 
            $CBFA..$CDD9   :   result:= 'T '; 
            $CDDA..$CEF3   :   result:= 'W '; 
            $CEF4..$D188   :   result:= 'X '; 
            $D189..$D4D0   :   result:= 'Y '; 
            $D4D1..$D7F9   :   result:= 'Z '; 
        else   
            result:=char(0); 
        end; 
    end; 
    而且这个函数应该放在那里?
      

  9.   

    你这个函数是sql函数还是C#函数?
      

  10.   


    --假设这就是你的汉字转换为拼音的函数
    create function funcChangeToPinYin(@columnName nvarchar(20))
    returns nvarchar(20)
    as begin
    declare @msg nvarchar(20)
    if @columnName='张三'
    set @msg = 'Zhangsan'
    return @msg
    end
    那么你执行的SQL就是这样:
    select * from 表名 where funcChangeToPinYin(列名) like 'Z%'
    这样就查询出拼音以Z开头的记录了
      

  11.   

    http://topic.csdn.net/u/20090531/17/9a3a17dd-53d0-44d1-bc12-ac8a3daa78d8.html
      

  12.   

    没看懂,是这样吗?select * from tb where col like '%A%'select * from tb where charindex('A' , col) > 0
      

  13.   

    猜测如下
    select ID, 姓名, 性别, 年龄 from tb where TForm1.GetPY(姓名)='A'
      

  14.   


    http://topic.csdn.net/u/20090918/20/bfe8cf06-9e5e-4e01-a1c9-c44fe7a76e63.html