cannot pass time to function

2012-01-27 Thread John Heim
I'm trying to create a function that formats a time in a standard way ('%H:%i'). But all I can seem to get back is null. DROP TABLE IF EXISTS bogus_table; CREATE TABLE IF NOT EXISTS bogus_table ( btime TIME ); INSERT INTO bogus_table VALUES ('12:34:56'); DROP FUNCTION IF EXISTS bogus ; DELIMIT

group by & left join

2006-12-07 Thread John Heim
I need to write a query that joins 3 tables, a master with 2 detail tables and I need to end up with 1 row per each row of the master table. The tables are students, previous_institutions, and test_scores. So what I want is the first previous institution and the average of the scores. table st

left & right join?

2006-05-23 Thread John Heim
I need to write a query that essentially does both a left and right join. I have a list of people and the rooms they occupy. Some rooms have no people. Some people have no room assigned. This gives me a list of rooms and how many people are in each room including any rooms with nobody in th

Re: Coded fields

2006-05-05 Thread John Heim
At 01:41 PM 5/5/2006, sheeri kritzer wrote: The best way to do it is NOT to make new codes. If they're giving you codes, use theirs -- why make up a new system if you don't have to? [...] Well, I made up my own codes before I knew I had to import data from somewhere else. I was quite happy with

Coded fields

2006-05-04 Thread John Heim
What is the best way to create a coded field? I want to do something similar to enumeration but I don't want to have to define the values at table creation time because sometimes the end-users need to add or remove the codes. I've been using char binary fields in my database to this point fi