We're a community of 1.1M IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,080,464 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Queries

List the customer number and name for all customers located in the city of Grove. Your query should ignore case. For example, a customer with the city Grove should be included as should customers whose city is GROVE, grove, GrOvE, and so on.

Can someone explain if I am doing this correctly. Thanks

My Answer:

SELECT CUST_NUM, CUST_NAME
FROM CUSTOMER
WHERE UPPER (CITY) = UPPER(GROVE);

3
Contributors
2
Replies
1 Day
Discussion Span
1 Year Ago
Last Updated
3
Views
Taino
Newbie Poster
8 posts since Nov 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

Hello Taino,

Your query is right! :-), well almost

where UPPER(CITY) = 'GROVE'; is the only correction. alternatively, you could use the 'Lower' function

where LOWER(CITY) = 'grove';

Try this also:
select cust_num, cust_name from customer where upper(city) = upper ('grove');

seslie
Junior Poster
105 posts since Mar 2010
Reputation Points: 66
Solved Threads: 10
Skill Endorsements: 0

@Taino - In your query, when you do not place single quotes around the string, SQL will intrepret that as column name rather than a string.

JorgeM
Industrious Poster
4,173 posts since Dec 2011
Reputation Points: 297
Solved Threads: 569
Skill Endorsements: 119

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page generated in 0.0594 seconds using 2.64MB