distal-attribute
distal-attribute
distal-attribute
distal-attribute

query

User, date Message
Written by brenda
4 weeks ago
Category: General
1 posts since Tue, 26 Aug 14
I have a query that someone else created. I was able to update it to display birthdate. Now I want to limit results to gender = female. How do I do that?

Thanks!

USE ArenaDB
SELECT person_id,last_name,first_name,suffix as person_suffix,gender,birth_date,street_address_1 as address,city,state,postal_code,email
FROM core_v_person_basic AS a
WHERE 1 < (SELECT Count(*)
FROM core_v_person_basic AS b
WHERE b.first_name = a.first_name
AND b.last_name = a.last_name
AND b.street_address_1 = a.street_address_1
AND b.first_name <> '')
Written by jfalchMoney, Euro
4 weeks ago
407 posts since Sat, 17 Oct 09
a) buy a book on SQL for beginners. If you cannot modify such a relatively simple query, you need it.

b) in this particular case, add

AND a.gender="..."

after the ")". (first use
SELECT DISTINCT gender FROM core_v_person_basic
to find out how genders are represented in this table; then use one of these values instead of ...)
Written by alfiqmiq
3 weeks ago
30 posts since Sun, 02 Mar 14
I can reccommend book:http://www.amazon.com/MySQL-5th-Edition-Developers-Library/dp/0321833872
 

Please login to leave a reply, or register at first.