在oracle数据库中进行SQL查询 [英] Sql query in oracle database

查看:101
本文介绍了在oracle数据库中进行SQL查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Oracle数据库中有一个表(karno,年,月)



我尝试过:



我想写一个查询来显示一个月内的kar列表,​​例如(月= 1,月= 3,月= 5,月= 7,月= 9) ,month = 11)

I have a table in Oracle database(karno,year,month)

What I have tried:

I want to write a query to shows me list of kar that among within a month for example( month=1,month=3, month=5, month=7, month=9, month=11)

推荐答案

如需了解更多信息,请试试这个

For want of more information, try this
SELECT year, month, count(*)
FROM yourTable
WHERE month IN (1,3,5,7,9,11)
GROUP BY year, month

如果要列出实际记录,请改为:

If you want to list the actual records then do this instead:

SELECT karno, year, month
FROM yourTable
WHERE month IN (1,3,5,7,9,11)
ORDER BY month, karno


这篇关于在oracle数据库中进行SQL查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆