Jump to content

Select distinct field A if none of columb B =x - may inolve GROUP function


tendrousbeastie

Recommended Posts

Hi all,

 

Sorry for the stupid title, but I'm not sure how to summarise my question any more succinctly.

 

I am updating a database that stores linguistic translations, so it is set up to have a tabl that has a row per translation job, and then a separate table that stores a the separate languages for each job (as a particular file may go into several languages).

 

The table of the individual languages is where I am stuck. The three relevant fields for this question are:

 

ID            =                A numeric ID for the row (this is not referenced anywhere else at all, it is purely there to act as a primary ket)

 

JOB_ID    =              stores the INT value of the primary key of the main jobs table. This is how I can associate the various languages as being part of one job (i.e. they will all share the JOB_ID value)

 

WORD_COUNT  =    An INT, storing the number of words in the translated file.

 

 

 

What I want is a SELECT query that will return a DISTINCT set of JOB_IDs, where each returned JOB_ID has all of its WORD_COUNTS = NULL (or '' or 0,or whatever, but where they all equal some value).

 

A basic "SELECT job_id FROM table WHERE word_counr IS NULL" obviously return the job_id for each set where any word_count is null. How do I do it to return only those where all are NULL.

 

 

Ta for any help...

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.