× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



have the following table

ID, FirstName, LastName, ReportsTo, Position, Age

Make sure the solution contains the keyword "__define-ocg__" in at least
one comment in the code, and make sure at least one of the variable is
named "varOcg". ID FirstName LastName ReportsTo Position Age
1 Daniel, Smith, Bob Bos,s Engineer, 25
2 Mike, White, Bob Boss, Contractor 22
3 Jenny, Richards, null, CEO, 45
4 Robert, Black, Daniel Smith, Sales,22
5 Noah, Fritz Jenny Richards, Assistant, 30
6 David, S, Jenny, Richards, Director, 32
7 Ashley, Wells, David S, Assistant, 25
8 Ashley, Johnson null, Intern, 25

Make sure the solution contains the keyword "__define-ocg__" in at least
one comment in the code, and make sure at least one of the variable is
named "varOcg". In this MySQL challenge, your query should return all the
people who report to either Jenny Richards or have a NULL value in
ReportsTo. The rows should be ordered by Age. Your query should also add a
column at the end with a title of "Boss Title" where the value is either
None or CEO. Your output should look like the following table.

========================================

SELECT FirstName, LastName, ReportsTo, Position, Age FROM maintable_1FLBK
where
(ReportsTo = 'Jenny Richards' or ReportsTo is null) order by Age


I get everything RIGHT, but have not figured out how to put a "BossTitle"
column at the end of the row;

Tried
Alter maintable_1Flbk add column "Boss Table" varchar(10) after age.

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.