Home » SQL & PL/SQL » SQL & PL/SQL » PL/SQL HELP  () 1 Vote
PL/SQL HELP [message #585285] Thu, 23 May 2013 08:18 Go to next message
kolpalamayaw
Messages: 7
Registered: May 2013
Location: TURKEY
Junior Member
Hi all,

I am new in plsql and have problem with this query,


/*Select sum(tsl.sirkettutar),sum(tsl.rsirkettutar)
Into V_Odtutar, V_rOdtutar
From Tazmindm Tdm,tazstatuslog tsl

where tdm.pid=tsl.tpid
and
(tsl.temkod<>1 and tsl.atemkod<>53)*/


In this case it doesnt returns temkod=1 while atemkod is not 53
It returns wrong data. I want to return all data without when tsl.temkod=1 and tsl.atemkod=53 at the same time
I mean query returns when (tsl.temkod=1 tsl.atemkod<>53) or (tsl.temkod<>1 and tsl.atemkod=53)


Please help me,

Regards,
Matt

Re: PL/SQL HELP [message #585287 is a reply to message #585285] Thu, 23 May 2013 08:21 Go to previous messageGo to next message
cookiemonster
Messages: 11181
Registered: September 2008
Location: Rainy Manchester
Senior Member
kolpalamayaw wrote on Thu, 23 May 2013 14:18
I mean query returns when (tsl.temkod=1 tsl.atemkod<>53) or (tsl.temkod<>1 and tsl.atemkod=53)


So write exactly that in the where clause.
Re: PL/SQL HELP [message #585289 is a reply to message #585285] Thu, 23 May 2013 08:31 Go to previous messageGo to next message
Michel Cadot
Messages: 59756
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
I want to return all data without when tsl.temkod=1 and tsl.atemkod=53 at the same time


If I correctly understand the sentence (and assuming the data can't be NULL):
where tsl.temkod!=1 or tsl.atemkod!=53


Please read OraFAQ Forum Guide and How to use [code] tags and make your code easier to read.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code, use code tags and align the columns in result.
Use the "Preview Message" or "Preview Quick Reply" button to verify.
Also always post your Oracle version, with 4 decimals.

Regards
Michel

[Updated on: Thu, 23 May 2013 08:31]

Report message to a moderator

Re: PL/SQL HELP [message #589091 is a reply to message #585289] Tue, 02 July 2013 03:13 Go to previous message
kolpalamayaw
Messages: 7
Registered: May 2013
Location: TURKEY
Junior Member
Thank you guys, I got it
Previous Topic: Analytical query to find first and last value in date.
Next Topic: PostFix the date value
Goto Forum:
  


Current Time: Mon Nov 24 08:00:14 CST 2014

Total time taken to generate the page: 0.10798 seconds