Jump to content

Kokoro

Members
  • Posts

    4
  • Joined

  • Last visited

Kokoro's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. Well, I've found the answer, but I don't feel like posting it. Nobody here seems to care much about sql anyway.
  2. Ok, I have two tables:TotalSales:EmpID Employee Sales1 Employee1 1002 Employee2 2103 Employee3 90TodaySales:EmpID Sale1 422 35I need to update the first table by summing up the sales from the secod table to the sales from the first table of the corresponding employee. The updated table should look like this:TotalSales:EmpID Employee Sales1 Employee1 1422 Employee2 2453 Employee3 90Any idea?
  3. Well, to answer my own question,SELECT * FROM( SELECT Column1 as C1, Column2 as C2 FROM Table1 UNION SELECT Column3, Column4 FROM Table2) as ResultORDER BY Result.C1, Result.C2
  4. Hi, I have this problem Suppose I have two tables with two columns each. I use a union to retrieve the info from both tables like this:SELECT Column1, Column2FROM Table1UNIONSELECT Column3, Column4FROM Table2Is there a way to sort the result by the first or second column without using the column number?
×
×
  • Create New...