select

How to do: sum columnB where columnA is XYZ - in Excel?

Hi I have a bunch of columns and some columns which are values I need to add. Lets say I want to sum columnB (which could be $) where column A is banana, how do I do that? Thing is I have a huge dataset and it is something that is going to keep changing. And besides banana, i might have apples, oranges, etc. And I want to sum the $ val...

How to turn this MySQL SELECT query into a DELETE query?

I want to delete certain items from the database. I have the following query: SELECT * FROM sheets, entries WHERE entries.sheetID = sheets.id AND sheets.clientID = 13 This works, and returns 2 results. Now I want to turn this SELECT query into a DELETE query. However, the following doesn't work: DELETE FROM sheets, entries WHERE ...

EASY PHP question?

HI Guys, I have following problem. I'm trying to connect from my Iphone app to a php site, to access the mySql db, to get the right information. This is my code: <?php mysql_connect ("localhost", "user", "pass") or die (mysql_error()); echo "Connected to MySql <br /><hr />"; mysql_select_db ("database_com") or die (m...

Non framework implementation of a hierarchical drop down for Firefox.

I need a hierarchical drop down <select><option/></select> for use within a browser, preferably Firefox. I'd rather not use a framework like jQuery. Please spare me the questions as to why. ...

Finding data closest to date?

I have a table CREATE TABLE `symbol_details` ( `symbol_header_id` int(11) DEFAULT NULL, `DATE` datetime DEFAULT NULL, `ADJ_NAV` double DEFAULT NULL ) with ~20,000,000 entries. Now I want to find the ADJ_NAV value closest to the end of the quarter for just one symbol_header_id: SET @quarterend = '2009-3-31'; SELECT symbol_head...

How do I handle a multiple select form field in Perl?

What is the best, in Perl, way to get the selected values of a multiple select form field? <select name="mult" multiple="multiple"> <option value="1">Opt. 1</option> <option value="2">Opt. 2</option> <!-- selected --> <option value="3">Opt. 3</option> <option value="4">Opt. 4</option> <!-- selected --> <option value="5">...

How to do a firebird SP, SELECT * FROM "TABLE"?

I'm migrating from SQL Server to Firebird. In SQL Server CREATE PROCEDURE Departments_GetAll AS SELECT * FROM Departments I try in Firebird CREATE PROCEDURE DEPARTMENTS_DELETEALL AS BEGIN SELECT * FROM "Departments"; END^ SET TERM ; ^ But that doesn't work. It returns an error "SQL Code -104" ...

SQL Server Search, how to return the total count of rows?

Hello, I have another post which resulted in this SELECT DISTINCT a.ArticleID, COUNT(*) AS KeywordMatch, a.Headline, a.ShortDescription, a.CategoryID, a.ArticleSectionImage, a.DatePublished FROM Article a JOIN SearchWords sw ON a.ArticleID = sw.ArticleID WHERE EXISTS ( ...

Automatically match columns in INSERT INTO ... SELECT ... FROM ...

Hi! SQL Server question. When doing INSERT INTO T1 SELECT (C1, C2) FROM T2 I don't want to specify column names of T1 because they are the same as in T2 Is it possible to do so? Currently I'm getting error Msg 213, Level 16, State 1, Line 1 Column name or number of supplied values does not match table definition. ...

how to add the values stored in a session variable in php?

Okay I have two pages-- page1.php and page2.php .Both of these pages have select lists.I have posted the values selected by the user to script.php which has them stored in session variables. I need to add the values (which are the ones selected by the user from the select lists in both the pages) and display this total value in page3....

how to make two-level chained select box(drop down list) in php+mysql

Hello, I can manage to get values from mysql using select box in php, but i can't make it with two-level chained select box. Anyone have some example code or idea for that? Thanks. ...

Get the selected option from a list

hello, I'm trying to get the selected option via jQuery everytime I change it, and eventually the value attribute, buy I always have problems with js!! HTML <select> <option value="us">United States</option> <option value="gb">United Kingdom</option> <option value="de" selected="selected">Germany</option> <option value="fr">France<...

How to change options of <select > with jQuery?

Suppose a list of options is available,how to update the <select> with new ones? ...

jQuery Highlight element on select option

I have a list of values in a drop down style select box e.g. <select id="places"> <option>Italy</option> <option>France</option> <option>Germany</option> <option>Spain</option> </select> I also have the same list of values in a div on my page e.g. <div> <span>Italy</span> <span>France</span> <span>Germany</span> <span>Spain</span> </...

How to implement a "hasChildren" SELECT statement in SQL?

Let's say I have the following table: ID | parentID | MoreStuff 1 | -1 | ... 2 | 1 | ... 3 | 1 | ... 4 | 2 | ... 5 | 1 | ... How can I generate an SQL SELECT statement to find out if a specific row has children? In other words, I want to know if ID 1 has children, which in this case it has 3...

Change/update a select box

Hello, I would like to fire an event when a select box is updated, I've tried with change() but this function only work when the user use his mouse to select an option in the selec box. So when I choose option using his keyboard (arrow or first letter of the option element) nothing happen =/ A solution was to use keydown() but as l...

Converting drop-down select input to radio buttons which require one to be chosen

I'm using an e-commerce system which allows you to have several variations for each product - (for instance: large, medium, small t-shirts). However, we are having complaints from customers who add a t-shirt and ignore the variation. As a result, a lot of big people are getting small t-shirts (the default). To solve this, I'd like to for...

MySQL Beach Ball from NOT IN query

I have two queries that each return a list of node ids SELECT node.nid FROM dpf_node AS node WHERE node.type = 'image' AND node.nid; SELECT node.nid FROM dpf_node AS node, dpf_image_galleries_images AS image WHERE image.image_nid = node.nid AND node.type = 'image' AND image.gallery_nid = 138; Both of these are work...

SQL Query between 3 tables

I have 3 tables (note this may not be the best sql db design) Room: TypeName, RoomNumber RoomType: TypeName, ... Reservation: StartDate, EndDate, TypeName, RoomNumber My input parameters are startdate and enddate. I'd like to know the distinct roomtypes available. From my understanding the solution goes like this: AvailableRoomTypes...

SQL - Update table changing one column value based on another table

Hi. Sorry if the title is not as descriptive as it should be but it is kind of difficult to explain in one sentence what I am trying to do ;). I have one table that links parent objects with its respective childs. And I have another table with all the objects (parents and childs) with its respectives images. However, the image is just s...