MySQL : retrieve a large select by chunks

You could try using the LIMIT feature. If you do this: SELECT * FROM MyTable ORDER BY whatever LIMIT 0,1000 You’ll get the first 1,000 rows. The first LIMIT value (0) defines the starting row in the result set. It’s zero-indexed, so 0 means “the first row”. The second LIMIT value is the maximum number … Read more

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 open the select input using jquery

This should work: var element = $(“select”)[0], worked = false; if (document.createEvent) { // all browsers var e = document.createEvent(“MouseEvents”); e.initMouseEvent(“mousedown”, true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); worked = element.dispatchEvent(e); } else if (element.fireEvent) { // ie worked = element.fireEvent(“onmousedown”); } if (!worked) { // unknown browser … Read more