Hi,
I was wondering what the advantages/disadvantages or doing a MySQL replace vs. doing either an update or insert statement are.
Basically,
doing
dao.replaceEntry(entry);
instead of:
if(existing){
dao.insertEntry(entry);
} else {
dao.updateEntry(entry);
}
Also, would it be misleading to call the dao.replaceEntry ...
I am trying to make some changes to an oracle database and have a script put together to do so. The problem is when it gets to a point in the script where I am creating a trigger it seems like the Create Trigger block does not properly terminate, when I look at the trigger afterwards it contains all of the remaining code in the script.
...
Greetings all,
In SQL Svr 2005 I created a new schema for my database called GSOC whose owner is dbo. I then created a local SQL user account with the default schema set to GSOC - my new schema name. I have one View that I want this schema to control access to, so I added the local SQL account to the View's permissions granting SELECT p...
Hi All, not sure why this is not working..
UPDATE
ust
SET
ust.isUnsubscribedFromSystemEmails = 1
FROM
UserSetting AS ust
INNER JOIN
[User] ON ust.userID = [User].userID
AND
[User].emailAddress IN (SELECT emailAddress FROM BadEmailAddresses)
In plain English, I am trying to set the isUnsubscribed fiel...
In sql server 2005, the autogrowth is enabled by size.
Is there any way to check when autogrowth on data and log file happened last?
...
I have a table with the following structure:
timestamp, tagid, value
I want a query where I can receive only the newest timestamped values for a list of tag id's. For example:
SELECT * FROM floatTable WHERE tagid IN(1,2,3,4,5,6)
Will return the entire set of values. I just want the latest stored value for each one.
...
Imagine I have the following SQL query:
SELECT id,name FROM user WHERE id IN ('id1','id2','id3')
Now imagine I need the array of ids to be supplied by PHP. So I have something like this:
$idList = array('id1','id2','id3');
$query = "SELECT id,name FROM user WHERE id IN (?)";
$stmt = $db->prepare($query);
$stmt->bind_param(/*Somethin...
I have properties and I need to list the ones mapped as "Founding Members" first, and then alphabetically while the rest that aren't need to come afterwards and be listed alphabetically.
properties table:
------------------------
id name
1 Gaga Hotel
2 Foo Bar Resort
properties_features
------------------------
feature_id pro...
Access 2007 / SQL / VB
I have a query:
SELECT Count(*) AS CountOfCR1
FROM PData
WHERE (((PData.DestID)='CR1') And (((PData.AnswerTime)>=Starting)<Ending+1));
I am trying to pass the variables Starting and Ending to the above query from the below form:
Starting = StartDate & " " & StartTime
Ending = EndDate & " " & EndTime
On Error G...
I have a question about the fastest way to perform a SQL Server query on a table, TheTable, that has the following fields: TimeStamp, Col1, Col2, Col3, Col4
I don't maintain the database, I just can access it. I need to perform 10 calculations that are similar to:
Col2*Col3 + 5
5*POWER(Col3,7) + 4*POWER(Col2,6) + 3*POWER(...
Hi, I need fast answer (I can't check that code right now):
is that query works ? I need to get the total sum of a column values from the subquery, something like that:
select sum(select time from table) as sometimes group by sometimes
...
I have a view where if I select like this:
select * from view where date = '17-sep-10'
it returns in seconds.
If I use a dynamic date:
select *
from view
where date = to_date((select current_business_date
from v_business_day),
'mm/dd/yyyy')
it returns in 20 mins.
Why would har...
Given time-series data, I want to find the best fitting logarithmic curve. What are good libraries for doing this in either Python or SQL?
Edit: Specifically, what I'm looking for is a library that can fit data resembling a sigmoid function, with upper and lower horizontal asymptotes.
...
Situation:
Table book is associated with one or more authors via the _author_book table. It is also associated with one or more genres via the _book_genre table.
When selecting all the books, and all their genres, and all their authors, the number of rows returned is (assume each book has at least one genre and author):
PROBLEM:
book...
I used this query to copy one full column from the same table:
UPDATE 'content_type_chapter'
SET 'field_chapternumbersort2_value' = 'field_chapternumbersort_value'
But I have received this error.
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use nea...
Does anyone know how to add a description to a SQL Server column by running a script? I know you can add a description when you create the column using SQL Server Management Studio.
How can I script this so when my SQL scripts create the column, a description for the column is also added?
...
Hello. Does anyone know what would be more efficient and use less resources:
Method 1-- Using a single SELECT statement to get data from one table and then iterating through it to execute multiple UPDATEs on another table. E.G. (pseudo-code, execute() runs query):
Query1_resultset = execute("SELECT item_id, sum(views) as view_count F...
In Microsoft SQL Server 10, how do I set constraint, that column in table with data type nchar(50) must be unique?
...
I am forced to use a dumb-as-nails Windows program (called IDCentre, made by Datacard, if you have the deep misfortune to use it) that says it can deal with ODBC databases.
So, I hooked it up to my MySQL database. All is well so far.
Then I noticed that it barfs when it attempts to do an update. The SQL that MySQL deems bad contains ...
Declare Status varchar(15)
set status = 'Returned','Cancelled','Rejected'
I pass parameter 'processing' and 'Completed'
I want to find out 'processing' and 'Completed' is presented in Status group or not.
if it is presented true true else false.
plz help me ....
...