select

Redirect to controller with multiple parameters on Grails

Hi All, I am developing a web app in Grails and I need to redirect my current page to another controller, passing to it multiple parameters. The exact scenario will be to have a from with multiple SELECT menus and have on them all a call to this controller on their "onChange" property, passing to it the current value of all the SELECT ...

MySQL Query, Subquery optimization, SELECT, JOIN

I have one table with some data and I want select newest data for each type... Table: +----+------+------+---------------------+ | ID | data | type | date | +----+------+------+---------------------+ | 1 | just | 2 | 2010-08-07 14:24:48 | | 2 | some | 2 | 2010-08-07 18:07:32 | | 3 | data | 9 | 2010-08-06 02:5...

How to build this query in sqlite?

Hello :) I have sqlite3 database with example structure and data: CREATE TABLE person(id INTEGER PRIMARY KEY NOT NULL, name STRING NOT NULL); INSERT INTO "person" VALUES(1,'Jack'); INSERT INTO "person" VALUES(2,'Daniel'); INSERT INTO "person" VALUES(3,'Sam'); INSERT INTO "person" VALUES(4,'T`lc'); CREATE TABLE vote(person_id INTEGER NO...

Row Level Revision Queries MySQL.

I currently implement some kind of version control for values in a table. I have a composite primary key between bookingId and revision. I want to be able to select all records from this table which are the head revision? I am not sure what I should be doing. [ bookingDetailsTable ] : [ bookingId ] [ revision ] [ name ] etc... SELE...

select only third li

how do i select only 3rd( or some other no. of my chioce) li element with jquery? for ex: how do i change the background of only third li with jquery. any help please ...

NHibernate - define fetching strategy dynamically

Let me explain the problem - hopefully I have defined it well in the title but I want to be sure. I have a linq query that pulls back a bunch of objects (say Foos). Each Foo holds a reference to a User. Each User holds a reference to a Person: public class Foo { //properties omitted... public User CreatedBy {get;} } public class Us...

JQuery Shift-Select Issues

List of items in a listbox populated using jquery. I click the first item and it's selected. I shift clicked the 3rd item and now items 1-3 are selected. Shift clicking the 6th item only selects 3-6th instead of 1st-6th as you would expect. Any idea how to fix something like this? :) Turns out it WAS a logic error on my side. Took me ...

How to filter out similar rows (equal on certain columns) based on other column data.

How would I select all rows distinct on Forename and Surname and where there's a duplicate select the one with the higher SomeDate, then Id if still duplicates e.g. For: | Id | Forename | Surname | SomeDate | ---------------------------------------- | 1 | Bill | Power | 2011-01-01 | | 2 | James | Joyce | 2011-02-01 | | ...

LEFT JOIN of a string

On part of my site, users enter multiple search terms. Each of these search terms may return 0 rows, or return several. I perform a UNION on all the searches and get the rows. Thing are much easier for me if I can get all the search terms in the response, regardless of whether they return any rows. Is there a way to essentially LEFT ...

How to return maxvalue or nullvalue in SQL?

Hello, I'm running requests on an Oracle database. One of my tables contains time slots for Elements and there can be several time slots for the same Element so that the following example is correct : ID ELEMENT_ID BEGIN_DATE END_DATE -------------------------------------------- 1 1 01/01/2007 01/06/2007 2 ...

Coloring substrings in an HTML multiple select option

I have a multiple select box that is populated with a set of options that contain a substring that a user enters as a keyword in a search. The user can then select what they want from the generated select box. To make things easier, I would like to highlight the substring in each of the options in the select box. Is this possible, and...

How can I SELECT from multiple tables in CodeIgniter

This is really boggling my mind on how to do this in ActiveRecord Queries in CodeIgniter. Maybe I'm over complicating it. I have three tables: (to keep it simple I'll only show the relevant fields) Articles (id, title, text, author) Comments (id, article_id, text, author) Users (user_id, user_type, first_name, last_name, email, passwo...

How to tally column values of multiple rows with pure mysql?

hypothetic tables user_id | hits Can I get MySQL to return the total hits of a Select query? I know i could add them together with php or similar, just wondering if there is a pure MySQL way? ...

SQL Sever: in...case...in WHERE clause

Hi, I need to code up a query for something like this: Select [something] Where condition in case when (if another_condition = A and 3rd Condition = B) then (C,D) when (if another_condition = N and 3rd Condition = E) then (F,G) else (J,K) end essentially, what I want is if A and B are met, condition could be set to either C or D, if N...

how do i show the options in a select box when i tab into the box?

I am building an application and have a page with a bunch of select boxes where the user must set different options... How do i show all the options that are available when the user tabs into the box? Currently i can tab into the box and start typing and it will search through the options, but it does not show the available ones. Is th...

IE: Unicode characters in HTML select and option tags

I need show options in a select with unicode characters. Try this: <select id="ddlNota_CateId"> <option value="1091">&#26641;&#31435;&#20351;&#29992;ICT&#30340;</option> </select> And show unrecognized charcaters (树立使用ICT的). :s Example in http://200.115.217.50/test.html ...

mysql select parent id of the records that match all values from array

Hi there, I have a problem with the sql query. I have a joint table which stores records with reference id of the record in the parent table and id of the record from the other table. Now - to make it a bit clearer: Table 1: "products_properties" : 'id', 'product', 'price' Table 2: "products_properties_options" : 'product_property',...

Is it possible to send an AJAX request on load?

Hello I have two dependants select box, the second one is popularited after onchange event. The first one is loaded with a selected value (selected=selected), what I'm asking, it is possible to send the requested while the page is loading, ie as I have the the selected option, just send the request. Javascript function getXMLHTTP() { ...

Dynamic Dropdown List from SQL with JS

Hi All, Please help, I have a dynamic JS table, so you can add and delete rows by clicking a button. One field that I need to add within the row is a select box, no problem so for and I use the following: var cell2 = row.insertCell(1); var sel = document.createElement('select'); sel.name = 'selRow' + rowCount; sel.options[0] = new Opti...

Jquery event for select tag closing

I can hook into the change event of the select fine (Which will cause the select to close), which is not a problem. But I also need to detect when the select tag is closed by way of clicking on the screen elsewhere. So far everything I've tried hasn't worked; body click, body focus, select blur, select focusout are among the few combina...