Hi
in mysql how to write a sql like this, to get the amount of X 20 and <20
select date, numberOfXMoreThan20,numberOfXLessThan20, otherValues
from table
group by (date, X20 and X<20)
thanks
Consider the following MS SQL Server table:
ID | X | Y
------+-------+-------
1 | 1 | 1
2 | 1 | 2
3 | 1 | 3
4 | 2 | 40
5 | 2 | 500
6 | 3 | 1
7 | 3 | 100
8 | 3 | 10
I need to select the ID of the row that has the maximum value of Y grouped by x, i.e:
ID | X | Y
------+-------+-------
3 | 1 | 3
5 | 2 | 500
7 | 3 | 100
The query will be nested several times so an optimal performance solution is required...
Thank you!
The table has data of city and its branchs/atms
CITY TYPE NAME
----------------------------------
agra atm X
agra branch X1
delhi atm X2
agra atm X3
agra atm X4
delhi branch X5
chennai branch X6
The result set expecting is
CITY ATM BRANCH
------------------------------------
agra 3 1
delhi 1 1
chennai 0 1
Whether we can do this in one select statement.
I've an access database table with 3 fields :
Purchase date
Warranty time
Warranty expiry
Warranty time has 1, 2, 3, 4, 5 in it which corresponds to years.
How can I auto-populate the 'Warranty expiry' field (which is a date field) by looking at the 'Purchase date' and then adding on the 'Warranty time' (warranty time will be 1 = 365 days, 2 = 730 days, etc)?
I have a table which stores data with null valued columns for some entries .I want to retrieve only Not null data to the detail view. I tried the following
foreach(string strTableField in (objDataSet.Tables[0].Columns[i]))
{
if(objDataSet.Tables[0].Columns[i].Equals(null))
{
objDataSet.Tables[0].Columns.Remove(strTableField);
objDataSet.Tables[0].AcceptChanges();
}
i++;
}
but it is giving error .. Pls help me reg this ...
I am using CakePHP for a price-comparison website.
I have a table products with fields: id, pride_regular, price_action.
I would like to combine the fields price_regular and price_action into a dynamic field: price. The lowest value of these two fields should be the value of the new price field. Also I want to order on it Ascending.
Should I use a custom MySQL-query?
Hi,
Ive got table:
UserA,
UserB,
numberOfConnections
I would like to write query which returns me only rows that has no reverse I mean or example :
for data :
1 2 10
1 3 10
1 5 10
1 6 10
2 6 10
2 5 10
5 1 10
5 2 10
3 1 10
it should return
1 2 10
1 3 10
1 5 10
1 6 10
2 6 10
2 5 10
rows:
5 1 10
5 2 10
3 1 10
arent valid because there are already corresponding
1 5 10
2 5 10
3 1 10
thanks for help
bye
How to specify blob type in MS Access? I have office 2007 installed. I am using jdbc, but this should not matter for the SQL query I am passing. Tried to pass a length to it, or FILE type, did not help.
CREATE TABLE mytable (
[integer] INTEGER not null,
[string] VARCHAR (255),
[datetime] DATETIME,
[boolean] BIT,
[char] CHAR,
[short] SHORT,
[double] DOUBLE,
[float] FLOAT,
[long] LONG,
[blob] BLOB, // does not work
Primary Key ([integer])
)
I have a table (EmployeeID,EmployeeName,ManagerID) How can I create a sqldatasource to include the ManagerName from the EmployeeName given EmployeeID = ManagerID? In my gridview after dragging a dropdownlist what bindings should I do to display the managerName? Is it possible to use it without writing custom select,insert,delete,update? If not what are the steps I need to do to write the whole thing i.e. custom grid and source?
Thank you very much
Hi,
I am trying to accomplish the task of
Making a Wed request
-getting result in JSON format
-Parsing the result
- and finally display the result in a table....
Any help regarding any of the task is welcome....
Hi everybody,
I tried to pass a filepath to a function in R, but I failed =/ I hope someone here can help me.
>heat <- function(filepath)
{ chicks <- read.table(file=filepath, dec=",", header=TRUE, sep="\t")
...
}
When I call the function, nothing happens...
>heat("/home/.../file.txt")
... and "chicks" is not found
>chicks
Error: Object 'chicks' not found
What is the correct way to pass a path to a function?
Best wishes from Germany,
Phil
I want to add a Check Constraint to a table for server 2005 but cannot work it out.
MemberId ClubId MeetingId
1 100 10
2 100 10
3 100 10
7 101 10 <-This would throw a check constraint
1 100 11
2 100 11
I do not want to have more than one ClubId for a single MeetingId
Basically a ClubId can only belong to a single MeetingId but can have more than one member assigned.
How do I achieve this?
Here is the table data with the column name as Ships.
+--------------+
Ships |
+--------------+
Duke of north |
---------------+
Prince of Wales|
---------------+
Baltic |
---------------+
Replace all characters between the first and the last spaces (excluding these spaces) by symbols
of an asterisk (*). The number of asterisks must be equal to number of replaced characters.
I have data from a database loaded into a JTable through a custom table model. I want to have a column (should be the first column) which simply shows the display row number (i.e. it is not tied to any data (or sorting) but is simply the row number on the screen starting at 1). These "row headers" should be grayed out like the row headers.
Any idea how to do this?
Thanks
Hi
I need some advice regarding multiple records. I have a table with fields username,*message* and message_to. the scenario could be of sending same message to multiple users in a go. What do you suggest? will it be efficient to save all recipients in a single column with comma separated values or I add multiple entries ?
Thanks
/A
Hi all,
I am a newcomer to hibernate. It would be great if someone could comment over the following query that i have:
Say i have a parent class and each parent has multiple children. So the mapping file of parent class would be something like:
parent.hbm.xml
<hibernate-mapping >
<class name="org.demo.parent" table="parent" lazy="true">
<cache usage="read-write" region="org.demo.parent"/>
<id name="id" column="id" type="integer" length="10">
<generator class="native">
</generator>
</id>
<property name="name" column="name" type="string" length="50"/>
<set name="children" lazy="true">
<cache usage="read-write" region="org.demo.parent.children" />
<key column="parent_id"/>
<one-to-many class="org.demo.children"/>
</set>
</class>
</hibernate-mapping>
children.hbm.xml
<hibernate-mapping >
<class name="org.demo.children" table="children" lazy="true">
<cache usage="read-write" region="org.demo.children"/>
<id name="id" column="id" type="integer" length="10">
<generator class="native">
</generator>
</id>
<property name="name" column="name" type="string" length="50"/>
<many-to-one name="parent_id" column="parent_id" type="integer" length="10" not-null="true"/>
</class>
</hibernate-mapping>
So for the set children, should we specify the region org.demo.parent.children where it should cache the association or should we use the cache region of org.demo.children where the children would be getting cached.
I am using EHCache as the 2nd level cache provider. I tried to search for the answer to this question but couldnt find any answer in this direction. It makes more sense to use org.demo.children but I dont know in which scenarios one should use a separate cache region for associations/sets/collections as in the above case. Kindly provide your inputs also let me know if I am not clear in my question.
Thanks all.
hi, i i want to activate scrolling vertically through programming for 2 UITableview at sametime?(one table view length 160,another one has 160).is it possible ?In one Viewcontroller's view i have scrollview, on that i have two tableviews(instead of one,like two column)..how can i scroll vertically both at same time?any help please?
Like the title says, I am having issues with a VERY long string overflowing my page. I tried some overflow techniques, but none seem to work.
I had previously posted this as a Primefaces problem, but have since learned that it is not a Primefaces issue. Anyway, if anybody has any suggestions on how I can fix this, I would appreciate it. I will post my HTML below so you can see what I am talking about.
Thanks for taking the time to read, and have a great day. :-)
<!DOCTYPE html>
<html>
<head>
<title> problem </title>
<style type="text/css">
span.troubleSpan {
overflow: scroll;
}
</style>
</head>
<body>
<h4> problem </h4>
<div>
<table border="1">
<tr>
<td>
<span>cell</span>
</td>
<td>
<span> </span>
</td>
<td>
<span>cell</span>
</td>
<td>
<span class="troubleSpan">asdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdf</span>
</td>
<td>
<span> </span>
</td>
</tr>
</table>
</div>
</body>
</html>
When I do:
IStandaloneTableCollection collection = (IStandaloneTableCollection)MxDoc.FocusMap
Then collection.StandaloneTableCount returns 0.
I have created the new table via ArcCatelog and registered it as versioned.
What am I missing?
When I tapped into any cell in tableview, blue color that shows us cell state (yes you tapped in!) always lights up and never disappears even if I go back to same table view through navigation. What's the reason ? I did not change anything with cell options ..
I have a collection of recipes, each having a number of ingredients. This information is stored in a join table. Give a recipe, I'd like to find recipes similar to it based on ingredients. How would I go about doing this?