Mozilla Firefox, Input Radio and Label tags

Posted by Alan | Posted in HTML | Posted on 15-03-2011-05-2008

0

Came across this anomaly today for the first time. Extending a form where the label tag defined a row with several radio buttons inside, for the basis of providing a rating system from 1-5.



In Firefox this demonstrates some weird behaviour where by if you click the 4th one, it’ll generally just select the first one, unless you vehemently keep clicking to get it to the correct value. Oddly this is valid HTML and works fine in IE, Opera and Chrome (and presumably Safari).

Read the rest of this entry »

SQL Example – Select different count of multiple where clauses

Posted by Alan | Posted in SQL | Posted on 04-03-2011-05-2008

0

Today I was writing a query to retrieve a number of records in a table which were associated to several different identifiers from a second table, which in turn were resolved from a third table.

I had a quick look on line to see if there were any quick examples I could start the basis off, but most examples were for just obvious queries or single count(*) and misrepresented. So I have an example of my solution below:

SELECT
	COUNT(1) as "Count",
	table2.name as "Name"
FROM table1
LEFT JOIN table2 on table2.id = table1.table2id
WHERE table1.table2id IN
(
	SELECT table2.id FROM table2 WHERE table2.field2='clause'
)
GROUP BY table2.name

Read the rest of this entry »