数据库查询语句快速入门

作者:桂季晗 | 发布日期:2024-05-07 06:18:36


本文目录一览

⒈access数据库查询语句在逻辑窗格中判断是否为[表单]![查询窗口]![采购订单号]));空
如果为空,则sql中的where部分就不要写
如果不为空,则拼出where部分
就可以了

⒉SQL数据库语句大全

SQL数据库数据的完整列表:

1.选择:从表1的范围中选择*

2。 输入:Insertintotable1(field1,field2)values(value1,value2)

3.删除:从table1whererange删除

4.更新:更新table1setfield1=value1whererange

5.Select*fromtable1orderbyfield1,field2[desc]

6.总计:根据表1确定总数

7

⒊mysql数据库sql查询语句:多条件判断

1.创建测试表,

createtabletest_person(idint,RMBint);

2.插入测试数据

insertintotest_personvalues(1180);

insertintotest_personvalues(2170);

insertintotest_personvalues(3290);

insertintotest_personvalues(4,160);

insertintotest_personvalues(5,299);

insertintotest_personvalues(6,266);

insertintotest_personvalues(7,155);

3。 在记录表中,选择.*fromtest_persont,

4。 编写SQL汇总各个VIP类型的用户数,

selectvip_type,count(distinctid)

100andRMB<200then'VIP1'whenRMB>200then'VIP2'endasvip_type,id

fromtest_person)t

groupbyvip_type