Let's say we have this table:
Symbol | Size
A | 12
B | 5
A | 3
A | 6
B | 8
And we want a view like this:
Symbol | Size
A | 21
B | 13
So we use this:
Select Symbol, sum(Size) from table group by Symbol order by Symbol ASC
But instead we get this:
Symbol | Size
A | 12
B | 5
What am I...
HI,
I 'm trying to sort the rows in my datatable using select method.
I know that i can say
datatable.select("col1='test'")
which in effect is a where clause and will return n rows that satisfy the condition.
I was wondering can i do the following
datatable.select("ORDER BY col1") ---col1 is the name of hte column
I tried datatab...
Say I have this dropdown:
<select id="theOptions1">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
I want it so that when the user selects 1, this is the thing that the user can choose for dropdown 2:
<select id="theOptions2">
<option value="a">a</option>
<option value="b">b...
Hiya,
I have another problem with sql queries running as I expect in PHPMyadmin, but when I add the sql to my PHP script, it does not work as expected.
This is the formula of my sql:
select DISTINCT
table1.id AS ID,
table1.title AS Title,
table1.startdate AS StartDate,
table1.enddate AS EndDate,
...
I have two tables
create table p
(
x number,
y number,
z number
);
create table q
(
a number,
b number,
c number,
d varchar2(20)
);
I have inserted
insert into p values('1','2','3');
now i need to insert into q selecting values from p with last field getting name like Table _name in table q
values such tha...
Hello,
How can I, using jQuery, set the "next" item of an already selected item as "selected."
For example, if I have:
<select>
<option value="1" >Number 1</option>
<option value="2" selected="selected">Number 2</option>
<option value="3" >Number 3</option>
<option value="4" >Number 4</option>
</select>
We can see that "Number 2" i...
In an (m by n) array stored as double *d (column major), what is the fastest way of selecting a range of rows and or columns:
double *filter(double *mat, int m, int n, int rows[], int cols[]);
invoked as:
double *B;
int rows[]= {1,3,5}; int cols[]={2,4};
B = filter(A, 5, 4, rows, cols);
which is expected to return a 3-by-2 subset ...
public function getWorksheetData($id) {
/** create the following query using select object:
SELECT wc.label, wd.notes FROM worksheet_data wd
LEFT JOIN worksheet_columns wc ON wd.column_id = wc.id;
*/
$id = (int) $id;
$select = $this->_db->select()
->from(array('wd'=>'worksheet_data'),
array('wc.label','wd.notes'))
->join(arr...
Situation:
Hello! I have a little problem in a C# project. I am using the Select method from a DataTable object and using an expression to get what I want but I am having some trouble with a space in one of the strings I am using for the expression.
So here is a code sample of what I have:
DataTable table;
//...
DataRow[] rows = tab...
I have an bean placed on my action Event.java, the action is Called ManageEvents. I would like the user to be able to add to a struts2 multiple select form field and create a list or map of items (in this case Map where the data would be .
<struts2:select name="event.dj_map" label="Add DJs To Your Event" list="event.dj_map" listsize="...
hello, have some divs, on some positions. i want select them with mouse, like when are you selecting object in photoshop. so i want to select group of divs. is that possible with jquery ? thanks
...
I'm currently writing some stylesheets for mobile browsers and have come across a strange issue in the Android browser. When changing the font-size CSS attribute of a text box the box gets bigger to accomodate the larger text. Doing this on a select box however does not change the size of the select box, but the text still gets larger (a...
How can you select question_id and tags for a question when one of the tags is known?
I am building a tag-search which searches questions by one tag such that the result shows the question and its tags including the one which was used in the search.
I use the same tables as in this question.
They are
Tables
questions | ...
This is a very standard newbie question, but I am looking for an expert clever way to do this with little code. (I know how to do this long hand, with procedural code and cursors, so we can skip that part of the answer.) Basically, I have a de-normalized data set for which I need to extract a normalized table in a set processing way. T...
Hi all,
I have a select box that shows 3 options: option1, option2, option3. When a user hits submit, then in $_POST I do have the value selected. Is there an easy way to redisplay the select box with the chosen option highlighted WITHOUT it being repeated in the options?
In other words, if option2 is selected and submit is clicked...
Using a case-then block, I need to choose how to order my SQL 2008 query, by [status] ASC, [date] DESC or just [date] DESC.
I know only how to use one column:
SELECT *
FROM table
ORDER BY
CASE WHEN @flag = 0
THEN R.[date] END DESC,
CASE WHEN @flag = 1
THEN R.[status] END ASC
How to use both columns in second CASE?
...
i have two tables in my database one is A other one is B
A is having few fields in which three are id,name,group
B is having feilds like id,title,description, etc.
i have to search the id's of title and description that are having data similar to table A's name or group and then have to insert the id's in a field of table A.
For exampl...
Hi all,
I'm creating an equipment reservation (PHP/MySQL) for my school.
My database looks like this:
tblEvents:
id
start
end
equipID
tblEquipment:
id
name
description
I'd like to know the best way to query the database based on a user's time parameters to see if a certain item is 'not available.'
For example, if I have...
I'm currently working on an Equipment Reservation System for my school.
Here's basically what my tables look like:
tblEquipment:
id name description
1 Camera Takes pictures
2 Projector Projects images
3 Stereo Plays music
tblEvents:
id equipmentID start...
Hello all,
I currently have 3 tables, which I'm using for people to make reservations for certain pieces of equipment.
Here are my tables:
tblEquipment:
id name description
1 Camera Takes pictures
2 Projector Projects pictures
3 Laptop Portable Computer
tblEven...