This just isn't working. I'm not getting any 'P' records. Help!!!
Printable View
This just isn't working. I'm not getting any 'P' records. Help!!!
Does the CHR(10) only work when both sides of the query pull from the same table?
Oh my god! I can't belive it - it's been almost a week since you've been given the CHR(10) hint and you are still struggling with it.
Can't you see that CHR(10) in the query is nothing but an ordinar constant, just like every other constant? So why would it behave differently if "both sides of the query pull from the same table" or not (whatever that actually means...)?
CHR(10) in this case is a constant is a constant is a constant. CHR(10) is a simple literal is a simple literal is a simple literal. Just like 'A' or '1' or 'z' or whatever single character literal string you choose. Nothing special about that, it has no special meaning to the query (it has special meaning to the operating system when interpreting the results returning from a query, though: on most systems OS will interpret it like "at this point we must break this line and skip to another one").
here is a simple example that returns all the employee's names and the department in which each of them work, for each employee printing his name and department into two sepparate lines:
I hope you can start your further exploration starting from this simple example.Code:select e.ename || chr(10) || d.dname
from scott.emp e, scott.dept d
where e.deptno=e.deptno;
I appreciate your comments and help. The only reason I'm pursuing this any further is because you had initially stated that I did not need to do a union, but using the solution you proposed, in this case, is not working.