I am not so into SQL and I have the following problem: I have to exclude a speific record from a query output if a particular condition is verified.

I have this query that can return 0, 1, >1 records:

```
SELECT
    LS.id                                                                                                       AS livestock_id,
    LS.parent_livestock_species_id                                                                              AS parent_livestock_species_id,
    LS.livestock_species_name_en                                                                                AS livestock_species_name_en,
    IFNULL(LSN.livestock_species_name, LS.livestock_species_name_en)                                            AS livestock_species_name,        
    LSN.description                                                                                             AS description,
    LS.image_link                                                                                               AS image_link,
    (
        select count(*) from LivestockSpecies ls2 where ls2.id = 1 or ls2.parent_livestock_species_id = 1
    ) as total_number
FROM LivestockSpecies                                                                                          AS LS
LEFT JOIN LivestockSpeciesName                                                                                 AS LSN
      ON LSN.livestock_species_id = LS.id AND LSN.language_id = 1
WHERE
    LS.id = 1
OR
    LS.parent_livestock_species_id = 1

```

The **total\_number** field count the total returned records and appear in each row.

I want that if this **total\_number** field contains a value >1 and if the **parent\_livestock\_species\_id** field value is \*\*null\* tis record is excluded from the query output.

Can I do something like this using SQL?