Hi there,
I was wondering if it is possible to move all rows of data from one table to another, that match a certain query?
For example, I need to move all table rows from Table1 to Table2 where their username = 'X' and password = 'X', so that they will no longer appear in Table1.
I'm using SQL Server 2008 Management Studio.
Thank yo...
hi expert
as per our last discussion regarding duplicate invoice no. and you have suggetsed code like:
create table Invoice
(
companyID int,
invno varchar(50),
primary key (companyID,Invno)
)
worked fine.
but another table is invcarat same has field like:
companyID(int) invno(varchar)
-------------------------...
Hello everyone,
Does anyone have any idea on how can you create a product filtering query (or queries) that will emulate the results on this page?
http://www.emag.ro/notebook%5Flaptop
Explanation
If you press HP as a brand, the page will show you all the HP products, and the rest of the available filters are gathered from this query ...
Hello,
I have a table with 450000 row full of news.
The table schema is like this:
CREATE TABLE IF NOT EXISTS `news` (
`id` int(11) NOT NULL auto_increment,
`cat_id` int(11) NOT NULL,
`title` tinytext NOT NULL,
`content` text NOT NULL,
`date` int(11) NOT NULL,
`readcount` int(11) NOT NULL default '0',
PRIMARY KEY (`id`),
...
I'm using my sql to get unique values from database
My query looks as follows, but somehow I'm not able to get unique results
SELECT
DISTINCT(company_name),
sp_id
FROM
Student_Training
ORDER BY
company_name
sp_id is the primary key, and then company_name is the companies name that needs to be u...
My SQL database (Firebird) has a table named tTransaction. It contains two columns, senderFK and receiverFK. There are three other tables, tBufferStock, tFacility and tOutsideLocation.
A sender or a receiver can be either a buffer stock, our own facility or a location outside.
My problem is that I don't know how to let senderFK or rece...
How to get server name through code if SQL Server (Standard Edition) is installed.
We pass the server name while creating a connection string to connect SQL Server. Can we retrieve this value through code?
string sqlConnectionString = string.Format(
"user id={0};password={1};server={2};Trusted_Connection=no;database=TestDB;
connection ...
Hello,
I develop against Oracle databases. When I need to manually write (not use an ORM like hibernate), I put join statements in the where clause sections.
for example (this is simplistic just to illustrate the style):
Select *
from customers c, invoices i, shipment_info si
where c.customer_id = i.customer_id
and i.amount > 99...
Right now I have a table for Photos. I expect this table to be hit a lot. Will I improve performance if I break it out into 3 tables if, for exmaple, I have 3 different types of photos? Or will this not improve performance?
...
Hello,
I have a table which logs the userid, course, sessionid and requestdate each time a webpage is loaded.
I want to calcuate the duration per userid for a given courseid.
It is problematic to do this due to overlapping timespans.
The data provided here should result in 10 minutes duration per user for course 1.
I can't seem to get ...
Hello!
Could somebody explain me how to store a escaped string in a column limited in size of a mysql table. I mean, if I have a column to which I define a size (let's say varchar(10)), if I insert "abcdefghij" the limit is reached, but if I insert "abcde'ghij" I exceed the limit since the escaped result of this last string is "abcde\'gh...
Hello:
I have a Tcl TK application that has a Sqlite back-end. I pretty much understand the syntax for inserting, manipulating, and reading string data; however, I do not understand how to store pictures or files into Sqlite with Tcl.
I do know I have to create a column that holds BLOB data in Sqlite. I just don't know what to do on ...
Hi
How would I convert the following to use INNER JOIN rather than nested SELECT?
SELECT
[Name].[NameValueID],
[Name].[NameTypeID],
[Name].[NameID],
[Name].[Value]
FROM [Name]
WHERE Name.NameTypeID IN ( SELECT NameTypeID FROM @tbNameType )
OR Name.NameID IN ( SELECT NameID FROM @tbName)
...
If I use like '%fish%' the following is returned
AQUARIAN GOLDFISH FLAKES
but if I use Contains([Description],' "fish*" ' ) it isn't is there something I can do?
Basically I want to return anything that has the word fish in it anywhere.
...
I have a table, let's call it History. The primary key (aka Clustered Index) is called HIST_ID. The table has some 2300 rows in the development DB. Now consider the following two queries:
Query 1:
declare @x int
set @x = 14289
select * from History where hist_id=@x
Query 2:
declare @x int
set @x = 14289
select * from History where...
I'm trying to figure out what I might be doing wrong. This query doesn't seem to be using the index, as its taking way to long.
When executing:
Explain SELECT a, b, c, d FROM `table` WHERE d = 4013456
id select_type table type possible_keys key key_len ref rows Extra`
1 SIMPLE table ALL...
I want to create a postgres function that builds the set of columns it
returns on-the-fly; in short, it should take in a list of keys, build
one column per-key, and return a record consisting of whatever that set
of columns was. Briefly, here's the code:
CREATE OR REPLACE FUNCTION reports.get_activities_for_report() RETURNS int[] AS $F...
Hi. I need to build some searching logic that produces ranked results. A simple example would be querying a table with firstname, lastname and zip code columns. The required output would be a list a rows that match, in order of the 'degree' of match.
I.e., the top results would be those that matched on all three columns, followed by tho...
Hi
I have a table "Events" for users to add events with the following fields:
EventID
EventName
EventSlot (--> slotID)
EventSlotExtra (--> slotID) (optional)
EventLimit
And I have another table "Slots"
SlotID (int)
SlotTime (this is 9am-10am, 10am-11am, etc)
I need to query both tables so I can get a total of people attendin...
Hi, Im using the sqlFile to include an sql script that creates tables using oracle specific commands (NOCACHE, NO PARALLEL, stuff like that). My master.xml file includes all sql scripts and executes them. However, when it detects a tag, it fails and prints this error message.
C:\update.bat master.xml
Migration Failed: cvc-complex-type....