WHERE (establishing criteria in SQL)

For many of the SQL instructions that tell use some criteria will be essential to identify which records will be involved in such instruction, for example, if I select a telephone listing of the schedule table may not want to show all contacts, but only those who living in Buenos Aires. This should tell you a standard cone using the WHERE clause shown below:

 SELECT surname, name, phone FROM book WHERE Province = 'Buenos Aires'

Then show several examples that show the possible options.
All contacts who live in Buenos Aires and well over 21 years:

 SELECT surname, name, phone FROM book WHERE Province = 'Buenos Aires' AND age> 21

All women between 20 and 27 years:

 SELECT surname, name, phone FROM book WHERE Sex = 'F' AND Age> = 20 AND age <= 27

All contacts who live in Ituzaingó or moron.
It is important to note that no contact can live in Ituzaingó and Moron. Live in or live in Ituzaingó moron so you must use the OR keyword to combine the two criteria.

 SELECT surname, name, phone FROM book WHERE location = 'Ituzaingó' OR city = 'Moron'

9 Responses to "WHERE (establishing criteria in SQL)"

  1. [...] Should be used (cnn). If you want to select only certain records need to add a WHERE condition to the instructions of [...]

  2. [...] Should be used (cnn). If you want to select only certain records need to add a WHERE condition to the instructions of [...]

  3. [...] Particular instance of source code. See also: GROUP, HAVING, ISA, REFERENCES OF, SELECT, WHERE, [...]

  4. berkah says:

    WHERE menggunakan bagaimana dengan dua kondisi nya g objek STRING

  5. berkah says:

    AND operator dengan ... s menggunakan listview

  6. Elisha says:

    Jika saya dengan tidak mengerti pertanyaan Benar Go, Go Kirim tapi saya akan bahwa untuk Haruz Dalam batch data string kutip tunggal ('). Misalnya: WHERE nama = 'Jack'

  7. [...] Should be used (cnn). If you want to select only certain records need to add a WHERE condition to the instructions of [...]

  8. cancuneitor says:

    and do not understand the comments.

    This brilliant that they fill the fields alone, put them with crackers (cokies)?

  9. th3r0rn says:

    This is super basic, and for the age between 20 and 27 years can use beetwen.
    Regards

Comment