mySQL query problem

Jul 21, 2008 19:49

I'm having a hellish time with a sql statement. I need to get nodes ("tnid" here) where a given user (uid = 1) has not translated a given language (language = "he", or rather, != as you'll see ( Read more... )

programming

Leave a comment

Comments 3

kmelion July 21 2008, 18:10:12 UTC
you want just the is not null, not the !=1

--Zach

Reply

lishablog July 22 2008, 09:37:11 UTC
No, see that's not giving me what I need, either.
Let's say that I want user 2 to get all the strings that she hasn't translated into Spanish yet.

mysql> select distinct tnid from fr_strings as st natural left join fr_tr_by_uid as ui where sid > 279 AND (uid is null OR language != "es");
+------+
| tnid |
+------+
| 872 |
| 873 |
+------+

This doesn't work. You see, uid 2 DID translate 870 into Spanish, but not 871 (see the first results table). I need her to get 871 for translation still, but this query won't give it to her. I'm still stuck.

Reply


justbeast July 22 2008, 16:33:49 UTC
Are you on IM of any sort? It'd be easier to chat about this..

Reply


Leave a comment

Up