something like this:
declare @story varhar(800)
set @story = (select story from story_table where story_id = 1)
update story_table
set story= @story + 'blah blah blah'
where story_id in (1,2,3)
Hello.
what is missing in my statement?
i need to count the number of Ns and Ys in my table.
select
CASE WHEN (P.ID =1 OR P.ID=4 OR P.ID=22 OR P.ID=2)
THEN 'N' ELSE 'Y' END AS SUB, count(SUB)
from MAIN P
group by SUB
Hi,
I have this table:
id value
1 neg
1 plus
3 neg
2 pos
1 nil
2 nil
i would like to transform it to:
id value
1 neg,plus,nil
2 pos,nil
3 neg
The order is very important.
I am looking for a solution without a cursor if possible.
I looked at this poste...
could you try this:
USE pubs
GO
SELECT substring (title_id,CHARINDEX('<DIV>', notes),CHARINDEX('</DIV>', notes)- CHARINDEX('<DIV>', notes) )
FROM titles
WHERE title_id = 'TC3218'
i took it from books on line:
-- Use the optional start_location parameter to start searching
-- for wonderful...
...incorrect and user2 100%.
this piece of code gives either a 0% or a 100% (per row):
AVG( CASE WHEN answer = user_answer THEN 1.0 ELSE 0.0 END ) * 100 AS percentage_correct,
I am hoping to have one percentage per user (and not per row).Meaning number of incorrect answers / total answers for...
Hello,
This is the first time I am trying to run sUb-totals and i am having some difficulty to do it.
the table i created is like this:
user answer user_answer
---------------------------
usr1 AG AG
usr1 AG AS
usr2 AG AS
usr2 HS AS
i am trying to count...
Hello, i know it is simple, but i can't get it to work!!!!
I have a file like this:
XX XX 1
XX YY 15
i need to count the number of correct and incorrect answers.
for that purpose, i am addind two columns "correct" and "incorrect"
for instance, for the first lign...
Hello,
Could you tell me what is the difference between an SQL 7 / 2000 database and a Prevasive database.
Are the queries the same ?
Do I have to learn a new langage ?
Thanks a lot
I think you should write something like this first:
FROM Companies INNER JOIN Customers
ON Customers.CustomerID = Companies.CompanyID
INNER JOIN Banks
ON Banks.BankID = Companies.BankID
INNER JOIN Receipts
Companies.CompanyID
ON BANK.BankID= Receipts.BankID
i used something like this in the past:
insert into table2
(id,name)
select
id, name
from table1
where id in
(select id from table1 where id not in
(select id from table2)
)
INSERT INTO table??
(number ,date)
SELECT
p.number ,m.date
FROM test p INNER join test_m m
on m.test_id = p.test_id
WHERE (id = @id ) ORDER BY p.number, m.date
if possible , i would like to use the following part only once for both queries:
SELECT distinct client_id
from main m inner join client p
on m.client_id = p.client_id
where (location_id = @location_id)
AND year ( date_done) = @year_of_request
then differentiate according to the age_id (a...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.