本文介绍了如何使用sqlite选择满足特定条件的表格?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 我为一个虚构的实验室社会创建了表格。其中一个表称为labbranch,我试图创建一个SQLite查询,选择等于或超过100米的表。 labbranch表有6行:labid,name,address,phone,sizeoflab,totaldeskspace。我只包括三个条目,其中两个超过100米。 谢谢 我尝试过: SELECT sizeoflab FROM lab WHERE sizeoflab = 100 ; 当我尝试这个陈述时,我收到错误解决方案 所以我的预期结果基于您的描述是获取Lab2和Lab3的详细信息。 当我运行查询时你已经尝试过我收到一条错误信息: I have created tables for a fictional lab society. One of the tables is called "labbranch" and I am trying to create an SQLite query that selects the ones that are equal to or over 100m.The "labbranch" table has 6 rows: labid, name, address, phone, sizeoflab, totaldeskspace. I have only included three entries, two of which are over 100m.thank youWhat I have tried:SELECT sizeoflabFROM labWHERE sizeoflab=100;When I tried this statement, I received an error 解决方案 So my expected results based on your description are to get details for Lab2 and Lab3.When I run the query you have already tried I get an error message:This is because you do not have a table called lab. Fix that by using the correct table name:SELECT sizeoflab FROM labbranch WHERE sizeoflab=100;When I run that I get a single number, 100, returned. From my expected results I wanted 2 rows not one, and there isn't any useful information in the results I currently have either.So change it toSELECT labid, name, sizeoflab FROM labbranch WHERE sizeoflab >= 100;Which gives the results:labid name sizeoflab2 Lab2 1003 Lab3 101 这篇关于如何使用sqlite选择满足特定条件的表格?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
09-12 12:35