select id,cHospital from med_patient where cHospital is not null union
select id,cHospital1 from med_patient where cHospital1 is not
null union
select id,cHospital2 from med_patient where cHospital2 is not
null order by 1
throwing error like
*Notice*: Undefined index:
Hi ,
Thanks*
*SELECT * FROM (SELECT cHospital FROM MED_PATIENT where cHospital is not
null union select cHospital1 from med_patient where cHospital1 is not null
union select cHospital2 from med_patient where cHospital2 is not null ) A
order by 1
The sql command does eliminate nulls, that's what the clause where ... is
not null does. It appears you have an application that is rendering the
results so I would check the application to see if it is somehow putting a
null row on the screen. Or when you copied the SQL into your program you
Hi
My fields something like
hospital1,hospital2,hospital3,patientname,
Exact table look like
PatientName Hospital1Code Hospital2Code Hospital3Code
Bharani 1234NULL NULL
Kumar 56781234 NULL
Senthil
Am 02.01.2010 13:43, schrieb bharani kumar:
No Duplicate records,
select hospital1code from *yourtable* grop by hospital1
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org
bharani kumar wrote:
Hi
My fields something like
hospital1,hospital2,hospital3,patientname,
[...]
i know , i can display all hospital code with unique , but i dont in the
single column , with unique record,
Can you tell me how to do this ?
Would it be possible to reconsider your
Benedikt Schackenberg wrote:
Am 02.01.2010 13:43, schrieb bharani kumar:
No Duplicate records,
select hospital1code from *yourtable* grop by hospital1
This won't work as he's also looking for entities in the hospital2code
and hospital3code fields to be returned in the same resultset, but
Your table structure makes the SQL a little inelegant, but I'd say this
would give you what you seem to want:
select Hospital1Code from tab where Hospital1Code is not null
union
select Hospital2Code from tab where Hospital2Code is not null
union
select Hospital3Code from tab where
Hi First i want to thanks to my mysql groups,
Sorry , just now i find time to see mail,
Am not sure, but i guess this union solves my problem,
But let me check it, give me a time..plz
On Sat, Jan 2, 2010 at 7:24 PM, Jim Lyons jlyons4...@gmail.com wrote:
Your table structure makes the SQL a