Click here to Skip to main content
14,137,520 members
   

Database

 
AnswerRe: How can you get the alternate records from the table in the SQL? Pin
Santosh kumar Pithani4-May-19 2:31
professionalSantosh kumar Pithani4-May-19 2:31 
GeneralRe: How can you get the alternate records from the table in the SQL? Pin
CHill6014-May-19 2:30
protectorCHill6014-May-19 2:30 
SuggestionRe: How can you get the alternate records from the table in the SQL? Pin
Richard Deeming14-May-19 2:38
mveRichard Deeming14-May-19 2:38 
GeneralRe: How can you get the alternate records from the table in the SQL? Pin
CHill6015-May-19 2:36
protectorCHill6015-May-19 2:36 
JokeRe: How can you get the alternate records from the table in the SQL? Pin
Richard Deeming15-May-19 6:51
mveRichard Deeming15-May-19 6:51 
GeneralRe: How can you get the alternate records from the table in the SQL? Pin
Santosh kumar Pithani15-May-19 20:43
professionalSantosh kumar Pithani15-May-19 20:43 
QuestionA strange issue!The count of queries does not match data. Pin
Member 1409322316-Apr-19 23:17
memberMember 1409322316-Apr-19 23:17 
AnswerRe: A strange issue!The count of queries does not match data. Pin
Maciej Los16-Apr-19 23:34
protectorMaciej Los16-Apr-19 23:34 
Quote:
select  count(1) as num from(select  * from View_paymentApproval v1 where exists(select 1 from payment_Approval where contractNo=v1.contractNo and payNo=v1.payNo  and SendSAPStatus='0'  and v1.approvalManCode='zhouyx') )t


it returns 22 items


As to the semantic used in your statement: it does NOT return 22 items. It returns a number which should be equal to the count of records returned by the view.

As to the strange issue... I can't reproduce your issue, but i can recommend to test this statement:
SELECT COUNT(*) --or COUNT(1), because both statements are equal!
FROM View_paymentApproval v1
WHERE EXISTS (
    SELECT 1
    FROM payment_Approval
    WHERE contractNo=v1.contractNo AND payNo=v1.payNo AND SendSAPStatus='0' AND v1.approvalManCode='zhouyx'
)

SuggestionRe: A strange issue!The count of queries does not match data. Pin
Richard Deeming17-Apr-19 1:16
mveRichard Deeming17-Apr-19 1:16 
GeneralRe: A strange issue!The count of queries does not match data. Pin
Member 1409322317-Apr-19 15:27
memberMember 1409322317-Apr-19 15:27 
GeneralFavour sought from a MySql expert Pin
Ger Hayden16-Apr-19 21:50
memberGer Hayden16-Apr-19 21:50 
GeneralRe: Favour sought from a MySql expert PinPopular
Richard MacCutchan16-Apr-19 22:21
protectorRichard MacCutchan16-Apr-19 22:21 
GeneralRe: Favour sought from a MySql expert Pin
Ger Hayden16-Apr-19 22:34
memberGer Hayden16-Apr-19 22:34 
GeneralRe: Favour sought from a MySql expert Pin
Richard MacCutchan16-Apr-19 22:48
protectorRichard MacCutchan16-Apr-19 22:48 
QuestionSQL to retrieve record count for each column of a table with blank, not null, null and distinct count in oracle sql Pin
Member 1422994312-Apr-19 22:35
memberMember 1422994312-Apr-19 22:35 
AnswerRe: SQL to retrieve record count for each column of a table with blank, not null, null and distinct count in oracle sql Pin
Richard MacCutchan12-Apr-19 23:26
protectorRichard MacCutchan12-Apr-19 23:26 
GeneralRe: SQL to retrieve record count for each column of a table with blank, not null, null and distinct count in oracle sql Pin
Member 1422994313-Apr-19 0:40
memberMember 1422994313-Apr-19 0:40 
GeneralRe: SQL to retrieve record count for each column of a table with blank, not null, null and distinct count in oracle sql Pin
Richard MacCutchan13-Apr-19 1:07
protectorRichard MacCutchan13-Apr-19 1:07 
QuestionLinkedServer version Pin
Darrylw9912-Apr-19 4:59
memberDarrylw9912-Apr-19 4:59 
AnswerRe: LinkedServer version Pin
Mycroft Holmes12-Apr-19 12:43
memberMycroft Holmes12-Apr-19 12:43 
QuestionSQL Interview Pin
Member 1417944312-Apr-19 3:38
memberMember 1417944312-Apr-19 3:38 
AnswerRe: SQL Interview Pin
Richard MacCutchan12-Apr-19 6:34
protectorRichard MacCutchan12-Apr-19 6:34 
GeneralRe: SQL Interview Pin
Member 1417944312-Apr-19 22:36
memberMember 1417944312-Apr-19 22:36 
GeneralRe: SQL Interview Pin
Richard MacCutchan12-Apr-19 23:20
protectorRichard MacCutchan12-Apr-19 23:20 
GeneralRe: SQL Interview Pin
Eddy Vluggen16-Apr-19 2:54
mveEddy Vluggen16-Apr-19 2:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Cookies | Terms of Service
Web01 | 2.8.190518.1 | Last Updated 20 May 2019
Copyright © CodeProject, 1999-2019
All Rights Reserved.
Layout: fixed | fluid