how can i change the data in only one cell of a mysql table.
i have problem with UPDATE because it makes all the parameters in a column change but i want only one changed.how?
I have this mysql query:
SELECT *
FROM Customer c
JOIN eHRDemographic ehD ON ehD.CxID = c.CustomerID
JOIN CustPrimaryWeight cpW ON cpW.CxID = c.CustomerID
WHERE c.CustomerID =22703
GROUP BY c.CustomerID
ORDER BY cpW.CustPrimaryWeightID DESC
This doesn't really work correctly as the CustPrimaryWeight table has multiple enteries and it's simply joining the first entry and not the more recent one as the ORDER statement doesn't seem to do anything.
Any ideas?
hi. i want to make sure that only one instance of application run...
i added the mutex check but it causes problem in 64 bit system. the second way is to search process table.. This check can be easily defeated by renaming application. please tell me how to make sure that only one instance of application run.
Hi,
here is the "msg" table on mysql
sent_to customer msg read
------- -------- ------ -----
45 3 bla 0
34 4 bla 1
34 6 bla 0
45 3 bla 0
56 7 bla 1
45 8 bla 0
for example user whose id number is 45 logs in,
i want him to see this,
you have 2 unread msg to your "number 3" customer
you have 1 unread msg to your "number 8" customer
like a news feed
what query should i use for this ?
thx
I have some problem whith such mysql_query
INSERT INTO table VALUES ('', CURDATE()-1)
why if yesteday is last day of the month
the CURDATE()-1) result is like 2010-04-00
why not 2010-03-31
Hi, the following query
CREATE TABLE IF NOT EXISTS XY (
x INT NOT NULL ,
y FLOAT NULL ,
PRIMARY KEY(x)
)
INSERT INTO XY (x,y)
(select 1 as x ,(1/7) as y);
errors with
Error code 1064, SQL state 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INSERT INTO XY (x,y)
(select 1 as x ,(1/7) as y)' at line 7
Line 1, column 1
any ideas?
When I connect Access 2007 to SQL Server (whether by ADO recordset or by linked table) I no longer get check box lists (of available filter values) in the datasheet column filters.
Is this feature available only with MDB/ACCDB and/or DAO?
Based on the following table
Area S1 S2 S3 S4
--------------------
A1 5 10 20 0
A2 11 19 15 20
A3 0 0 0 20
I want to generate an output that will give the number of columns not having "0".
So the output would be
Area S1 S2 S3 S4 Count
-------------------------
A1 5 10 20 0 3
A2 11 19 15 20 4
A3 0 0 0 20 1
Hi,
I need to execute some Sql server stored procs in a thread safe manner. At the moment I'm using software locks (C# locks) to achieve this but wonder what kind of features provided by the Sql server itself to achieve thread safety. It seems to be there are some table and row locking features built in to Sql server.
Also from a performance perspective what is best approach? Software locks? Or Sql Server built in locks?
Thanks,
Shamika
I'm trying to import a text file into an access database. It's not one I've written myself but the spec for the delimited text file is set up properly and the file imports properly using the wizard. When I try to use the import functions of the app itself, the ImportError table tells "Field Truncation" for one of the fields. Any help would be appreciated.
Hi All,
I have created the sql file to create table in DB,
I am using PHPMYAdmin But i am not able to connect to the DB,
I want to run this as Batch file.
If i try to MYSQL from command prompt it give error as
'mysql' is not recognized as an internal or external command,
operable program or batch file.
Regards,
Dev
i have a view which presently returning single record when called....i like it to return three records may be upon inner joining a different view or temp table...as those records share the same data except single column... im not sure about this plz some one throw light on this please..thank you in advance
When using the repository pattern is it recommended to have one Repository class for each database table? Would I also map one service layer class to one repository class. I'm having a hard time trying to understand how much stuff one repository or service layer class should have.
Thanks!
If I have a relation (SQL) that does not fit in memory and I want to sort the relation using TPMMS (Two-pass multi-way merge sort method). How would I divide the table in sub tables (and how many) that can fit in memory and than merge them?
Let's say I am using C#.
How can I find elements that has at least one attribute?
Example:
<tr>...</tr>
<tr style="">...</tr>
<tr width="">...</tr>
I want all tr elements but ...
I tried following xpath but it doesn't work.
//table//tr[contains(attributes::*,'')]
Thanks
I have a number of database table that looks like this:
EntityId int : 1
Countries1: "1,2,3,4,5"
Countries2: "7,9,10,22"
I would like to have NHibernate load the Country entities identifed as 1,2,3,4,5,7,9 etc. whenever my EntityId is loaded.
The reason for this is that we want to avoid a proliferation of joins, as there are scores of these collections.
If I have a table like this:
pkey age
---- ---
1 8
2 5
3 12
4 12
5 22
I can "group by" to get a count of each age.
select age,count(*) n from tbl group by age;
age n
--- -
5 1
8 1
12 2
22 1
What query can I use to group by age ranges?
age n
----- -
1-10 2
11-20 2
20+ 1
Hi
I have checked these statements with mysql and no error will happen and also the out put will be 0 rows BUT my friend checked it and he found an error for SELECT becaouse it is out of range !! IS he correct? thanks
CREATE TABLE T1(A INTEGER NULL);
SELECT * FROM T1;
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>
I have the following table :
alertID inspectorID datelive dateread
1 none 2012-11-06 10:36:03.350 NULL
2 none 2012-11-06 10:36:25.043 NULL
3 none 2012-11-06 10:36:42.433 NULL
1 31030 2012-11-06 10:37:19.193 2012-06-11 10:34:47.000
I want to select the alerts that dont have the inspectors ID against it AND where the alert ID doenst match the one that has the inspectorID against it, ie inspector has read alert 1 so i only want it to return alerts 2 & 3
Am using Classic ASP and MS-SQL
Cheers
I've got a datagrid that is databound from a database table. How do I:
a) Edit the displayed value for a column using the values from other columns in the row? (For example, display a URL like:
<a href="/url?param=columnA">columnB</a>
where columnA is the value from column A and columnB is the value from columnB)
b) Add an additional column using values from the other columns (similar to a.)
Hi,
Does order of the columns in an Index definition for a table in a database has any effect on the performance?
for e.g. are these two queries different ?
CREATE INDEX xxx ON tablex(col1,col2)
CREATE INDEX xxx ON tablex(col2,col1)
what about the in case that I use a BTREE index?
I am using Mysql.
thanks
I have a small problem.
My action is :
public ViewResult SearchForRooms(int HotelDDL)
{
List<Room> roomsInHotel = bl.ReturnRoomsPerHotel(HotelDDL);
return View(roomsInHotel);
}
Here is the jquery that is calling the action:
<script type="text/javascript" language="javascript">
$(document).ready(function () {
$("#HotelDDL").change(function () {
var text = $("#HotelDDL option:selected").text();
var value = $("#HotelDDL option:selected").val();
alert("Selected text=" + text + " Selected value= " + value);
$.post("/Home/SearchForRooms",
{
HotelDDL: $("#HotelDDL option:selected").val()
});
});
});
</script>
And finally, here is the View that should be called:
@model IEnumerable<RoomReservation.Entities.Entities.Room>
@{
ViewBag.Title = "Search";
}
<h2>Result</h2>
<table>
<tr>
<th>
City
</th>
<th>
Hotel
</th>
<th>
Room label
</th>
<th>
Number of beds
</th>
<th>
Price per night
</th>
<th></th>
</tr>
@foreach (var item in Model) {
<tr>
<td>
@Html.DisplayFor(modelitem=>item.Hotel.City.Name)
</td>
<td>
@Html.DisplayFor(modelItem => item.Hotel.Name)
</td>
<td>
@Html.DisplayFor(modelItem => item.Name)
</td>
<td>
@Html.DisplayFor(modelItem => item.NumberOfBeds)
</td>
<td>
@Html.DisplayFor(modelItem => item.PricePerNight)
</td>
</tr>
}
</table>
Everthing is working ok (databse return all rooms correctly) except final view rendering.
I have tried Phil's tool but it doesn't give me any suspicious hints:
RouteDebug.RouteDebugger.RewriteRoutesForTesting(RouteTable.Routes);
So, why is it not showing after jscript send it's post method to SearchForRooms()?
Thank you
P.S. If you need any other piece of code please just say so.
i am trying to query from a temp table,and i keep getting the message
Msg 102, Level 15, State 1, Line 1 Incorrect syntax near ' '.
can somebody tell me wats the problem..is it due to convert..
plz help
The query is
select compid,2, convert(datetime, '01/01/' + CONVERT(char(4),cal_yr) ,101) ,0, Update_dt, th1, th2, th3_pc , Update_id, Update_dt,1
from #tmp_CTF