select

Substring test within DataTable.Select()

I have a DataTable with results already pulled down from a back end. I want to do a DataTable.Select(), but the criteria is based on a SUBSTRING of one of the columns. Is there syntax to use in the Select() method that allows for substring of a column test, or do I have to do it the hard way -- scan each row. ...

In Django form, custom SelectField and SelectMultipleField

I am using Django everyday now for three month and it is really great. Fast web application development. I have still one thing that I cannot do exactly how I want to. It is the SelectField and SelectMultiple Field. I want to be able to put some args to an option of a Select. I finally success with the optgroup : class EquipmentField...

MySQL Join from multiple options to select one value

I am putting together a nice little database for adding values to options, all these are setup through a map (Has and Belongs to Many) table, because many options are pointing to a single value. So I am trying to specify 3 option.ids and a single id in a value table - four integers to point to a single value. Three tables. And I am runn...

SQL join that displays left table even if right table doesn't match where

I have 2 tables, defined as such: CREATE TABLE `product` ( `pid` SMALLINT( 5 ) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, `name` VARCHAR( 50 ) NOT NULL, `description` TEXT, `qty` SMALLINT( 5 ) UNSIGNED NOT NULL DEFAULT '0', `category` ENUM( '1', '2', '3', '4', '5', '6', '7', '8' ) NOT NULL DEFAULT '1', `price` DECIMAL( 7, 2 ) UNSIGNE...

jeditable: how to use existing cell value as the "selected"

The cell that is editable contains either 0 or 1 (not Active or Inactive). How do I make it selected? I have tried something like below: $('#isEditable).editable("post.php?type=myPost", { data : " {'0':'Inactive','1':'Active','selected':'"+<< put value of the clicked on cell here >>+"'}", type : 'select' }); Currently Inac...

Properly Filter with PHP/MySQL and Select Box

Hello all, I currently have a large table in MySQL with several fields. I am currently attempting to allow the user to filter by each field, via Select Boxes. I have 4 fields: School, Division and State. I have no problem, using PHP, on how to filter based on which option the user selects in the select box. For example, if these 3 a...

How to get latest record date from column

Hi, I want to return the date and ID for the latest added record in on of our tables. can anyone suggest right query for that plz. We are using sqlServer SELECT [BGArx_ID], [BGArx_PUBLISHED_DATE] FROM TECH_ARTICLES WHERE [BGArx_PUBLISHED_DATE] = ??? ...

mysql Select question

hi There, I can't get on the right track with this, any help would be appreciated I have one table +---+----------+---------+-----------+ |id | match_id | team_id | player_id | +---+----------+---------+-----------+ | 1 | 9 | 10 | 5 | | 2 | 9 | 10 | 7 | | 3 | 9 | 10 | 9 | | 4...

Mysql - Select, order by times a column value appears in a string

Sorry, I should have explained better: I have a $string and I want 'table' to be ordered by the number of times each value under 'word' column appears in that $string. for that i need a query like: 'SELECT * FROM table WHERE $string LIKE CONCAT("%",LOWER(word),"%")... to find the words, then I would like to order them by appearance s...

JQuery URL Selector to Replace standard XHTML Form Dropdown

I'm certain this is a simple solution, but had no luck pinning down the right approach (just getting started with jQuery). So, here's the question: I have this HTML form: <form id="callSelect" class="full" method="post" action=""> <select name="Single"> <option value="/var-a/">Var A</option> <option value="/var-b/">Var B</opt...

How to select many rows from a dictionary (executemany select)

Hi everyone! I'm using Python and its MySQLdb module, is it possible to do a "selectmany"-like from a tuple/dictionary/list in the condition something like this: cursor.executemany("""SELECT * FROM customers WHERE name= %(name)s""",[d.__dict__ for d in data]) selected_rows = cursor.fecthall() doing a delete/update/insert works fin...

Sqlite group_concat select with "special needs"

I know how to use group_concat with Sqlite, to do the following: id - f1 - f2 - f3 1 - 1 - a - NULL 2 - 1 - b - NULL 3 - 2 - c - NULL 4 - 2 - d - NULL select id, f1, group_concat(f2), f3 from table group by f1 result: 2 - 1 - a,b - NULL 4 - 2 - c,d - NULL as you can see, the ID's 1 and 3 are dropped, which is the ...

How to take the near number in a column at Oracle Select.

Hello Folks, I have an adress table and I need to take the near number. For example if I´m entenring the number 256 in this case I´ll take 257 because: 254<--256->257 Somebody knows the solution. Thanks and sorry for my bad English. ...

PSQL select max value per minute per id for multiple values a minute per id?

Given a table that looks like this: sensor_id | time | voltage -----------+------------------------+------------ 12292 | 2009-12-01 00:50:04-07 | 2270 12282 | 2009-12-01 00:50:04-07 | 93774 12192 | 2009-12-01 00:50:04-07 | 9386 12609 | 2009-12-01 00:50:05-07 | 0 125...

c# LINQ XML how to add function inside select query

select new FeedResource { Title = (string)details.Element("title"), Host = (string)details.Element("link"), Description = (string)details.Element("description"), PublishedOn = (DateTime?)details.Element("pubDate"), Generator = (string)details.Element("generator"), Language = (string)details.Element("language") ...

Is there a jQuery plugin fit for main/sub select?

Like what this page does. ...

Html Select dropdown

is there any way i can trap html select events and can prevent the html select dropdown to open (disabling html select is ruled out) ...

multiple select

hi I need to get all the values selected in a drop down box.Please see the example. <html> <head> <script> function getSelected() { alert(document.myform.mytextarea.value); return false; } </script> <title></title> </head> <body> <form name=myform> <select id=mytextarea size=3 multiple> <option id=one value=one> one </option> <option id...

server side get multiple select values

A continuation of the previous question: http://stackoverflow.com/questions/1905534/multiple-select Is there a way to get the selected values in jsp(server side) ? ...

Using BETWEEN in a DataTable.Select

I thought this would be simple but obviously not! Basically, I have a date and want to do a 'between' on two date columns like this: myDataTable.Select(myDate & " between (StartDate and EndDate)") Where StartDate and EndDate are date columns that do exist in the DataTable. Any ideas? ...