How to change the text color of first select option

If the first item is to be used as a placeholder (empty value) and your select is required then you can use the :invalid pseudo-class to target it. select { -webkit-appearance: menulist-button; color: black; } select:invalid { color: green; } <select required> <option value=””>Item1</option> <option value=”Item2″>Item2</option> <option value=”Item3″>Item3</option> </select>

Oracle date difference to get number of years

I’d use months_between, possibly combined with floor: select floor(months_between(date ‘2012-10-10’, date ‘2011-10-10’) /12) from dual; select floor(months_between(date ‘2012-10-9’ , date ‘2011-10-10’) /12) from dual; floor makes sure you get down-rounded years. If you want the fractional parts, you obviously want to not use floor.

How to combine multiple columns as one and format with custom strings?

What about the CONCAT() function? SELECT id, CONCAT(lastname, ‘, ‘, firstname) AS name FROM `table`; If you are going to concatenate many fields, you could also consider the CONCAT_WS() function, where the first argument is the separator for the rest of the arguments, which is added between the strings to be concatenated: SELECT id, CONCAT_WS(‘,’, … Read more