select

Replace empty record of column with 'foo' on SELECT query?

I'm backing up MySql -table to worksheet. My current result-set has rows where some of columns are empty. That's ok, but for the worksheet i need these to be replaced with 'foo'. HowTo? All help is highly appreciated. ...

Selecting elements that don't exist

Hi! I am working on an application that has to assign numeric codes to elements. This codes are not consecutives and my idea is not to insert them in the data base until have the related element, but i would like to find, in a sql matter, the not assigned codes and i dont know how to do it. Any ideas? Thanks!!! Edit 1 The table can b...

MySQL - Concurrent SELECTS - one client waits for another?

Hi, I have the following scenario: I have a database with a particular MyISAM table of about 4 million rows. I use stored procedures (MySQL Version 5.1) and one in particular to search through these rows on various criteria. This table has several indexes on it, and the queries through this stored procedure are normally very fast ( <1s...

Select dropdown with fixed width cutting off content in IE

The issue: Some of the items in the select require more than the specified width of 145px in order to display fully. Firefox behavior: clicking on the select reveals the dropdown elements list adjusted to the width of the longest element. IE6 & IE7 behavior: clicking on the select reveals the dropdown elements list restricted to 145px...

Change the WHERE for a select on only one row depending on the field content

Ok, this may sound a little weird, but what I need to do is simple. I have a list of companies and each one has a description. The site is in 4 languages. My problem comes when I have listed a company in English but the person who is in charge of translating it in French still didn't make the translation, so I have a simple: SELECT TOP(...

Search XML Column in SQL

İ have an XML document to store against records in an Oracle Database. The table CourseXML will contain: Record_Number int XML_Type int XMLDoc clob ...etc İ would like to make a search in XMLDoc column by XML tags. The XML document has an XML Schema like this: <root> <UnitID="2" Name="Jerry" SName="Potter"/> <Unit...

Most efficient way to select 1st and last element, SQLite?

What is the most efficient way to select the first and last element only, from a column in SQLite? Thanks. ...

What data structure is behind FD_SET and FD_ISSET when working with sockets in c?

What data structure is behind FD_SET and FD_ISSET macro when working with sockets? ...

php select function generates weird where clause

Hello I try to create a function to generate select functions. But the following code public function select($psTableName, $paFields ="",$paWhere=array()) { //initial return value $lbReturn = false; try { $lsQuery = "SELECT * FROM `"; $lsQuery .= $psTableName; $lsQuery .= "` "; if (!empty($paWhere)){ $lsQuery .= "WHERE...

DataSet Select doesn't add up

I'm performing multiple Selects on a dataset. The total #records from all of these selects ought to match the total number of records in the dataset, but doesn't. (Total from all the selects is less.) I've read that .Net 1.1 Select had a bug w/ multiple AND conditions, but this is VS2005 & .Net 2.0. Here's the code: Note: Some row's cat...

Google Chrome breaks when onfocus sets select size

The following javascript to resize a select list breaks in Google Chrome. It works when tabbing into the field, but clicking on it results in the "Aw, Snap!" error page. <select onfocus="this.setAttribute('size', 3);"> <option>selectList with onfocus</option> <option>2</option> <option>3</option> <option>4</option> </select> Works fin...

HTML Class with <select>

I'm trying to design a Form class in PHP. So far, I have the <input> buttons pretty well working. But the <select> boxes have me stymied. I'm trying to figure out a "generic" way of adding the <option> tags, and am lacking the creativity. I'm not asking for teh codez, but implementation ideas are welcome. ...

MySQL performance optimization: order by datetime field

I have a table with roughly 100.000 blog postings, linked to a table with 50 feeds via an 1:n relationship. When I query both tables with a select statement, ordered by a datetime field of the postings table, MySQL always uses filesort, resulting in very slow query times (>1 second). Here's the schema of the postings table (simplified): ...

How to bypass Safari option re-ordering in a select ?

Hello everybody! Im writing a admin panel for a customer's sites, and at few places, i need to put a list of country. He want's to get Canada and US in first place, because his market are mainly US and Canada. So, i write something like that : <select name="customerCoutry"> <option value="US">United States</option> <option ...

execute sp in a select statement

For an instance I a select statement and it is returning 1000 rows. I need to execute a particular stored procedure for every row the the select statement is returning. have you got any idea how can I do that? ...

Strange Oracle problem

I tried to put it in a sentence but it is better to give an example: SELECT * FROM someTable WHERE id = someID; returns no rows ... some time passes (no inserts are done to the table and no ID updates) ... SELECT * FROM someTable WHERE id = someID; returns one row! Is it possible that some DB mechanism prevents first SELECT to retur...

Amazon-like interface for selecting product size and color (i.e., click a little red box to select a red product, etc)

In my online store, I want to implement an interface like Amazon's for selecting product size and color. I.e., instead of radio buttons for the different sizes / colors, the user should see a bunch of little boxes, each containing either a swatch of color or the name of a size. When the user clicks a box, the border should change to indi...

What is the best way to check if the currently selected option in a dropdown list is the last one?

I have a drop-down list and I've bound a change event handler to it. Whenever the user selects a new option, I want to know if it is the last option of the list. Annoyingly, the relevant condition in the snippet below always returns true, no matter which option has been selected: sel.change(function() { //this alwa...

make NSRect selectable.

Is there a simple way to create a selectable NSRect in Cocoa? In need a rectangle that can be selected and stays selected after a mouse click. Thanks. ...

Javascript focus() and select() quirk

Im working on a form and getting null or not an object errors in ie. <form action="#" method="post" name="adv_search"> <input class="inputbox" type="text" name="keyword1" value="none" id="keyword1"/> </form> <script> document.adv_search.keyword1.focus(); document.adv_search.keyword1.select(); </script> //whereas if I use <script> v...