Hey there,

first of all please CC my email address as I'm no longer a member of this 
list. Recieving too much stuff already (1000+ mails a day)

Anyways I found a general SQL manual which uses oracle to show it's demos. So 
I tried some of the examples in there some work but don't do the expected 
others don't work at all.

For the questions...

This one I don't find really important. If you had a table a with a field 
tekst (text) containing "test" and a field tekst2 containing "test" according 
to the mysql course this statement
select tekst || tekst2 total from table;
should return a virtual column called total with as value
testtest
it returns a virtual column called total alright on it's value is 0
I also tried this with + instead of || in oracle this should give an error 
since it aren't numeric fields in mysql it does the same as || (or atleast so 
it appears)


<copy from course>
INPUT:
SQL> SELECT * FROM FOOTBALL;

OUTPUT:
NAME
--------------------
ABLE
BRAVO
CHARLIE
DECON
EXITOR
FUBAR
GOOBER

7 rows selected.


INPUT:
SQL> SELECT * FROM SOFTBALL;

OUTPUT:
NAME
--------------------
ABLE
BAKER
CHARLIE
DEAN
EXITOR
FALCONER
GOOBER

7 rows selected.


How many different people play on one team or another?

INPUT/OUTPUT:
SQL> SELECT NAME FROM SOFTBALL
  2  UNION
  3  SELECT NAME FROM FOOTBALL;

NAME
--------------------
ABLE
BAKER
BRAVO
CHARLIE
DEAN
DECON
EXITOR
FALCONER
FUBAR
GOOBER

10 rows selected.


UNION returns 10 distinct names from the two lists. How many names are on 
both lists (including duplicates)?

INPUT/OUTPUT:
SQL> SELECT NAME FROM SOFTBALL
  2  UNION ALL
  3  SELECT NAME FROM FOOTBALL;

NAME
--------------------
ABLE
BAKER
CHARLIE
DEAN
EXITOR
FALCONER
GOOBER
ABLE
BRAVO
CHARLIE
DECON
EXITOR
FUBAR
GOOBER

14 rows selected.


ANALYSIS:

The combined list--courtesy of the UNION ALL statement--has 14 names. UNION 
ALL works just like UNION except it does not eliminate duplicates. Now show 
me a list of players who are on both teams. You can't do that with UNION--you 
need to learn INTERSECT. 

</copy>

these both don't work. I searched the manual but don't see UNION at all, is 
it supported? I'm figuring it isn't....

SQL> SELECT * FROM FOOTBALL
  2  INTERSECT
  3  SELECT * FROM SOFTBALL;

doesn't work either, i'm guessin intersect isn't implemented either?

kind regards and have a good weekend

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to