Hi Mike,
Apologies, you will also need to cater for the case in the Order By clause. Did you do that?
Thanks,
Karl.
-----Original Message-----
From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Smith, Mike
Sent: Tuesday, September 22, 2020 10:25 AM
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxxxxxxxx>
Subject: RE: [EXTERNAL] RE: wrkqry vs sql result difference
I just gave this a try, with the same results.
I also used the rtvqmqry command to get the select statement, which also gave the same results.
Thanks
MIke
-----Original Message-----
From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Karl Haggart
Sent: Tuesday, September 22, 2020 12:25 PM
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxxxxxxxx>
Subject: [EXTERNAL] RE: wrkqry vs sql result difference
Hi Mike,
Did you try to put the " ara" section in a case statement, so something like
Select case when ARA is null then ' ' else ARA end, , acct, name On acct = f2acct Order by ara, acct
Thanks,
Karl.
-----Original Message-----
From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Vernon Hamberg
Sent: Tuesday, September 22, 2020 9:15 AM
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxxxxxxxx>
Subject: Re: wrkqry vs sql result difference
Just for fun, Mike, you might try the RTVQMQRY command to pull the SELECT statement that corresponds to what is in the QRYDFN - it won't take care of the NULL issue but might be a handy way to get the SELECT statement that will get the same results - other than how NULL is handled, where Query gives a blank, SQL gives the hyphen.
Also, when you use RTVQMQRY, you can get messages that say what incompatibilities there might be.
Cheers
Vern
On 9/22/2020 8:03 AM, Smith, Mike wrote:
I have a query that I'm trying to convert to sql.
The query has a join file(2) matched records with primary file Sorted
by area and account
There are a dozen or so records not in the secondary file however,
when the results display I get something like this
AREA Account
' ' 1
' ' 2
' ' 3
AREA1 10
AREA1 11
When I convert this to SQL I don't' get the same results, because of
the NULL values, but I can't figure out how to get the null converted
to a space in the query My results look like this
AREA Account
' ' 2
AREA1 10
AREA1 11
- 1
- 3
I have tried using select ifnull(ara, ' ') as area
And coalesce(ara, ' ') as area
But no luck
My query looks like this
Select ara, acct, name
From file1 left outer join file2
On acct = f2acct
Order by ara, acct
Thanks
MIke
NOTICE: This message, including any attachment, is intended as a confidential and privileged communication. If you have received this message in error, or are not the named recipient(s), please immediately notify the sender and delete this message.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
https://linkprotect.cudasvc.com/url?a=https%3a%2f%2flists.midrange.com%2fmailman%2flistinfo%2fmidrange-l&c=E,1,aRFN2H-hPvouvKVzArp-Vn2CSU64nZxEg30aoM4WGeoqrdMnM7WFkLuV6ZTh14lvc5oxxj1wGFnwjnIV-6YDBse_I3JzmK8pOO_8Mn9U-YJOGjwA-5o,&typo=1
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://linkprotect.cudasvc.com/url?a=https%3a%2f%2farchive.midrange.com%2fmidrange-l.&c=E,1,O6eRZ-BwPHbImSfa-hPoRNZ_oAuG48YW1G1kpfIXuJd4IHe5XmzrPXmLHdRDd7P4BaSTsf_Ps-_O1JcJvzgDemSD8inRFM3SGCVvAt3zVj0C6XnVwS-3SA,,&typo=1
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related questions.
Help support
https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fmidrange.com&c=E,1,HiIjlKLr5AxuAyDybq5Fq1ad2GL_KlKcvs-cn2YyFbcqRVU7eTefTLVH5qWMDMNGYWqyFfyHiLIbTKSc0DXS164uDBLFSoRJ7uOG8PqpMtVla3A5qLtATt6ZxTzl&typo=1 by shopping at amazon.com with our affiliate link:
https://linkprotect.cudasvc.com/url?a=https%3a%2f%2famazon.midrange.com&c=E,1,mGy5Fo5-TMqiK8YDnaAhVLICRewhklS-Rri35ctOzLhw3oGNPq7Ef1LlFUPy2CCmbpbVPuol4daw9h3aYwOsnmbh9KbDVULfIzSpdQeINo9U1mc,&typo=1
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
https://linkprotect.cudasvc.com/url?a=https%3a%2f%2flists.midrange.com%2fmailman%2flistinfo%2fmidrange-l&c=E,1,fqG6NFFj0goOYRJPfzh68b1GR-o2FTo3b8DPJv0uGA8m3nXK0_ugdFx9bmadIWeeeNGMyYC01nCXI7O58YSfRR1dlyORoqS84uys9esyw_qy7OI9I6KwKDU,&typo=1
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://linkprotect.cudasvc.com/url?a=https%3a%2f%2farchive.midrange.com%2fmidrange-l.&c=E,1,HIQ1rOhNZP2KfoIJAkbMgLG31G1Kx4csF8snz5CWQN9h8_UgvSOJwVWzsBB03AyCRhsaaBHErcpukbktiO3dV8J1YMsjb-GT3VoRKyo6H-ALW38,&typo=1
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related questions.
Help support
https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fmidrange.com&c=E,1,WU76E8eYnLAeH0w_Q3oj4lERWEItjahBWKqiO_RJw7fYM4X94W7nlQaz_CEAVpwYJZbx57ihyjXDvcdvmsdx3yELKyATLx5ue-RDhHsMf0eqsUj2FCdufJLy&typo=1 by shopping at amazon.com with our affiliate link:
https://linkprotect.cudasvc.com/url?a=https%3a%2f%2famazon.midrange.com&c=E,1,YbyozQijqTrMI0FLJobQBacmDbaoWPJaaY2NWtxzyYKpJhdap99SZGrq-t6fE0VXZid1a3q10CaymQwugLKCmQnSO7QHlK8K9hCdPmM_Z9zP8Zsyl6ARRw,,&typo=1
NOTICE: This message, including any attachment, is intended as a confidential and privileged communication. If you have received this message in error, or are not the named recipient(s), please immediately notify the sender and delete this message.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/midrange-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related questions.
Help support midrange.com by shopping at amazon.com with our affiliate link:
https://amazon.midrange.com
As an Amazon Associate we earn from qualifying purchases.