Home » SQL & PL/SQL » SQL & PL/SQL » Create a select statement for below scenario (10g or 11g)
Create a select statement for below scenario [message #619452] Tue, 22 July 2014 12:31 Go to next message
sachinpawar80
Messages: 5
Registered: March 2010
Location: Pune
Junior Member
Table name employee have only one column called ename have all the records in upper case but some records in lowercase

write a select query and find out the field which is not in upper case

For example
select * from employee

JOHN
CAROL
MICHEL
RICHEL
COOPER
GEORGE
peter
Sam
apaRNA


As per above records below records should get displayed in the select query

peter
Sam
apaRNA
Re: Create a select statement for below scenario [message #619454 is a reply to message #619452] Tue, 22 July 2014 12:36 Go to previous messageGo to next message
EdStevens
Messages: 1376
Registered: September 2013
Senior Member
just off the top of my head ..


select ename
from employee
where ename != upper(ename);
Re: Create a select statement for below scenario [message #619457 is a reply to message #619452] Tue, 22 July 2014 13:43 Go to previous messageGo to next message
John Watson
Messages: 8931
Registered: January 2010
Location: Global Village
Senior Member
This looks like a school homework question - you need to show what you have tried so far, and explain what it is that you are having trouble with.
Re: Create a select statement for below scenario [message #619467 is a reply to message #619457] Tue, 22 July 2014 15:00 Go to previous messageGo to next message
Michel Cadot
Messages: 68645
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Or an interview question like all the other topics OP created.

Re: Create a select statement for below scenario [message #619474 is a reply to message #619452] Tue, 22 July 2014 16:45 Go to previous messageGo to next message
superboy87
Messages: 3
Registered: May 2014
Junior Member
Fairly simple one. This should do it/

select * from employees
where name<>upper(name)
Re: Create a select statement for below scenario [message #619496 is a reply to message #619474] Wed, 23 July 2014 01:09 Go to previous messageGo to next message
Michel Cadot
Messages: 68645
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Is this not what has already been posted?

Please read How to use [code] tags and make your code easier to read.

Re: Create a select statement for below scenario [message #619570 is a reply to message #619474] Wed, 23 July 2014 07:41 Go to previous messageGo to next message
EdStevens
Messages: 1376
Registered: September 2013
Senior Member
superboy87 wrote on Tue, 22 July 2014 16:45
Fairly simple one. This should do it/

select * from employees
where name<>upper(name)



DOH! Now why didn't I think of that?
Re: Create a select statement for below scenario [message #619666 is a reply to message #619570] Thu, 24 July 2014 04:52 Go to previous message
pablolee
Messages: 2882
Registered: May 2007
Location: Scotland
Senior Member
EdStevens wrote on Wed, 23 July 2014 13:41

DOH! Now why didn't I think of that?

Very Happy
Previous Topic: How to implement the below code in the PL/SQL?
Next Topic: Getting Unique Results
Goto Forum:
  


Current Time: Thu Apr 25 14:47:46 CDT 2024