如何根据某些计数获取特定数据. [英] how to get particular data against some counts.

查看:67
本文介绍了如何根据某些计数获取特定数据.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在编写一个sql查询,假设每个日期都有一些手机号码计数.
例如:-1月2日-我有2个号码(手机号码)
2月3日-我有4个电话(手机号码)

而且我也在比较其他表格中的日期.
所以我的问题是,如果我单击计数,那么我将如何仅获取该日期的移动电话号码.

我的代码是

选择DISTINCT A.MobileNo,convert(NVARCHAR(50),A.FTA_Date,103)AS FTA_Date,
convert(NVARCHAR(50),A.UploadedOn,103)AS UploadedOn,
A.Rejection原因来自FTA_ReportReject A,FTA_Report B


这里FTA_ReportReject和FTA_Report是两个表.
我的问题是,我一直在计数我单击的次数,我正在获取每个日期的所有值.


谢谢,
Diya ....

hello everyone,

i am writing a sql query where suppose there are some counts of mobile numbers against each date.
ex:- jan 2- i am having count 2 (mobile nos)
feb 3- i am having count 4 (mobile nos)

and i am comparing the date from other table also.
so my question is if i click the counts then how i will get the mobile nos for that date only.

my code is

select DISTINCT A.MobileNo,convert(NVARCHAR(50),A.FTA_Date ,103) AS FTA_Date,
convert(NVARCHAR(50),A.UploadedOn ,103) AS UploadedOn,
A.RejectionReason FROM FTA_ReportReject A,FTA_Report B


here FTA_ReportReject and FTA_Report are two tables.
my problem is i which ever counts i am clicking i am getting all the values for every dates.


thanks,
Diya....

推荐答案

检查示例并相应地更改您的内容.
Check the sample and change your accoedingly.
SELECT distinct
c.id, c.Column1,c.DateColumn,cat.Column1 FROM Table1 AS c
Inner Join Table2 as cat on cat.CatId=c.Id WHERE c.DateColumn='date'


这篇关于如何根据某些计数获取特定数据.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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