If I'm right you want to do a left join.
For example:

Table1:
Id              value
1               100
2               200
3               300

Table2:
Id      RefId           OtherValue
1       1               9000
2       1               10000
3       2               8000

If you do this:
select Table1.Value, Table2.OtherValue
from Table1 left join Table2 on Table2.RefId = Table1.Id

then the result is:
Value           OtherValue
100             9000
100             10000
200             8000
300             NULL

Kind regards
Hans van Dalen



At 15:37 15-10-03 +0200, you wrote:
I need to find out, using a join, which corresponding rows in a union that is missing. But it is among a certain "subselect" I want to do this, that is, among the rows where the column "lang" = 'uk' for example.

The two tables looks like following:

+-------+--------------------+-------+
| id | betegnelse | enhed |
+-------+--------------------+-------+
| 00046 | 838718001064311911 | 5 |
| 00120 | 641725001064311948 | 5 |
| 01310 | 532898001064317190 | 5 |
| 01320 | 535436001064317190 | 5 |
| 01330 | 537895001064317190 | 5 |
+-------+--------------------+-------+

den andra ser ut som

+------+--------------------+------+------+
| id | relid | lang | text |
+------+--------------------+------+------+
| 5513 | 838718001064311911 | dk | m |
| 5514 | 838718001064311911 | de | m |
| 5515 | 838718001064311911 | uk | m |
| 5517 | 641725001064311948 | dk | Stk. |
| 5518 | 641725001064311948 | de | Stk. |
+------+--------------------+------+------+

As you can see, the second one holds the language-strings for the first table. But as you also can see I'm missing the last row in table two which should read:

+------+--------------------+------+------+
| id | relid | lang | text |
+------+--------------------+------+------+
| 5519 | 641725001064311948 | uk | Stk. |
+------+--------------------+------+------+

What I would like to do is to list all rows, with null values, where lang != 'dk' or 'de', for example, or rather where lang = 'uk' to find out which that are missing.

(What I'm gonna do then is to list the missing texts for translation under a translation page in the admin-area. But thats at a later point - now I just have to select them....)

Best regards and lots of thanks in advance!

Sincerely

Victor // Malmoe and Copenhagen


-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to