the problem is Update the salary of all the employees by 50% who had worked on 5 or more than 5 projects, by 30% (>= 3 projects), by 20 % (>= 1 projects) the number of project is got by performing a group by query on the EMPLOYEE_PROJECT_HISTORY;
i have tried these queries
update emp set emp.sal=
case
when jemp.pcount >=5 then emp.sal...
I have a table where each row has a start and stop date-time. These can be arbitrarily short or long spans.
I want to query the sum duration of the intersection of all rows with two start and stop date-times.
How can you do this in MySQL?
Or do you have to select the rows that intersect the query start and stop times, then calculate ...
Hi,
I want to implement pagination using JDBC. The actual thing I want to know is "How can i get first 50 and then next 50 records from database for page 1 and 2 respectively"
My Query is Select * from data [data table contains 20,000 rows]
For page #1 I get 50 records and for page #2 I want to get next 50 records. How can I implement...
Let's say I have an ORACLE schema with contains a package.
That package defines types, functions, procedures, etc:
CREATE PACKAGE...
DECLARE
FUNCTION ...
PROCEDURE ...
END;
Is there a query I can execute to get the definitions of those individual objects, without the wrapping package?
...
Hi,
I have an SQL database table, I want to find everything in a table where the 'Room' says 'DISPOSED', Insert 'DISPOSED' into the 'Status' field and then delete the entry in 'Room'.
Basically moving the entry from one field to another (if the 'Room' field has 'DISPOSED' in it)
Hope this makes sense.
Thanks for any help.
...
My table structure looks like this:
create table rankings (
id IDENTITY NOT NULL,
user_id INT NOT NULL,
game_poule_id INT NOT NULL,
rank INT NOT NULL,
insertDate DATETIME NOT NULL,
FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE,
FOREIGN KEY (game_poule_id) REFERENCES game_poules(id) ON DELETE CA...
How to auto increment an id in SQL Server whenever a new row is inserted in the table?
This id is primary key of the table.
...
I got the above error in my jasper report mail. The query that is used in the report is quite complicated (for me). Reading different posts I conclude that to solve this the I have to change the query to
SET TRANSACTION ISOLATION LEVEL REPEATABLE READ
GO
BEGIN TRANSACTION
... my query ...
COMMIT TRANSACTION
? I wonder if this is the ...
Hey, I'm struggling to copy the Primary Key to another field in Access.
This is irrelevant , but clarifying on what I'm comparing.
... WHERE Tunniste=" & [Tarkiste] & ""
Tunniste = Primary Key , Autonumber , ID (Generated by Access.)
Tarkiste = This is the field I want to copy it to compare it.
I'm open to suggestions, I've already...
I asked a question yesterday about password safety...
I am new at security...
I am using a mysql db, and need to store users passwords there. I have been told in answers that hashing and THEN saving the HASHED value of the password is the correct way of doing this.
So basically I want to verify with you guys this is correct now.
It i...
Hi,
i want to configured the configuration file to use more than one MSDB database, which are stored in separated database instances in Stored packages of SSIS database. if any body knows let me know ?
write in steps how to do..?
Regards.
kumar
...
Hello everyone,
Because I am new with SQL Server and T-SQL, so I will need your help.
I have 2 table: Realtime and EOD. To understand my question, I give example data for 2 tables:
---Realtime table---
Symbol Date Value
ABC 1/3/2009 03:05:01 327 // this day is not existed in EOD -> inserting
BBC 1/3/2009 03...
Hi there, we've had a ASP.NET web application deployed for a number of years now.... last week we migrated to a slightly slower server to save some money.
Now we're frequently getting command timeouts:
Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding
This is understandable...
this error occurred when run site
Login failed for user 'NT AUTHORITY\NETWORK SERVICE
...
Hi,
I'm trying to do some work with my SQL table.
I have 2 buildings with room numbers 1 - 100 in building 1 and 101 - 199 in building 2.
I have a location field (which I've just created) and want to run a query to populate it with either 'Building 1' or 'Building 2' depending on which room number it has in the 'Room' field.
Many than...
I have an entity, TrackLog that has a component collection of TrackPoints. I create a new TrackLog and add some Trackpoints to it and save it to the DB.
When I grab my TrackLog again and add a new TrackPoint, instead of doing one SQL INSERT like I expect, it's doing a DELETE on all the TrackPoints associated with the TrackLog and then r...
I would like to load all objects that have a textual tag set to any of a small but arbitrary number of values from our database. The logical way to go about this in SQL would be to build an "IN" clause. JPQL allows for IN, but it seems to require me to specify every single parameter to IN directly (as in, "in (:in1, :in2, :in3)").
Is th...
I'd like to automatically generate an update script each time a value is modified in my database. In other words, if a stored procedure, or a query, or whatever updates column a with value b in table c (which as a pk column (i,j...k), I want to generate this :
update c set a=b where i=... and j=... and k=...
and store it somewhere (fo...
Ok, I would like to use a CASE STATEMENT for this, but I am lost with this. Basically, I need to update a ton of rows, but just on the "position" column. I need to UPDATE all position values that are great than the position value that was removed to position - 1 on a per id_layout and id_layout_position basis.
OK, here is a pic of wha...
I am creating a hierarchy representaion of a column. But an error occurs
Details are
Msg 240, Level 16, State 1, Line 1
Types don't match between the anchor
and the recursive part in column
"DISPLAY" of recursive query "CTE".
I know there is some typecasting error. But I dont know how to remove error. Please just dont only s...