...how hard can be a deadline problem so I help as soon as I can.
I think this is what you want...
SELECT Iif(DateAdd("d",t1.RenewalMonths*30,t1.RenewalDate)>date(),"Active", "Expired")
FROM tbl t1
where t1.RenewalDate =
( select max(tbl.RenewalDate)...
It's strange what you say. The syntax looks ok and i don't know why this does not work.
Do you really need those nulls? If not, it's simple: try to filtrate in where with cudefis not null . senior rdbms specialist
If you try to enforce unique constraint you could use NULL value, but only once. So, it is possible , but doesn't help you much. For your needs I recommend a trigger or to enforce integrity on the application level. senior rdbms specialist
...(CBO). It will rarely choose to use an index on column referenced using an OR statement. It will even ignore optimizer hints in this situation. The only way of guaranteeing the use of indexes in these situations is to use the /*+ RULE */ hint.
but this is another story.
senior rdbms...
You perform mathematical operations on the indexed(i think) column(s), so in both situations you will have table access full, so both are bed or equally good ;) senior rdbms specialist
What about this little one ?
select TT1.*,compl,tries from
(
SELECT A.id AS dep,
sum(A.ant) AS sales,
FROM A
WHERE YEAR(A.d)=2002
GROUP BY A.id
) tt.1 LEFT JOIN
(
select S.id AS dep
,COUNT(S.res) AS compl
,SUM(S.el) AS tries
FROM S
WHERE YEAR(s.d)=2002
GROUP BY s.id...
what about this one?
SELECT A.id AS dep, SUM(distinct A.ant) AS sales, COUNT(S.res) AS compl, SUM(S.el) AS tries
FROM A LEFT JOIN S ON A.id=S.id AND A.d=S.d
WHERE YEAR(A.d)=2002 GROUP BY A.id; senior rdbms specialist
try this:
select distinct s.sname
from stocks s,order_detail od, order o
where o.ono=od.ono
and s.sno=od.sno
group by s.sname
having count(distinct o.cno)=(select count(c.cno) from customer c)
senior rdbms specialist
...CREATE OR REPLACE FUNCTION CHECKN(word VARCHAR2) RETURN NUMBER IS
i NUMBER;
j NUMBER:=0;
BEGIN
FOR i IN 1..LENGTH(word) LOOP
SELECT j+COUNT(*) INTO j FROM dual
WHERE SUBSTR(word,i,1) NOT IN ('0','1','2','3','4','5','6','7','8','9');
IF j>0 THEN RETURN(j);
END IF;
END LOOP;
RETURN j;
END...
...tram named desire','desire')+length('desire')))=4
will have this output
a tram named desire
so...
in an abstract way is this:
select * from table
where wordcnt(substr(field,1,instr(field,searched_pattern)+length(searched_pattern)))=value_of_pozition_wanted
Are you satisfied?
web/sql...
...1 company, user_id, maincontact
from pt5_user xx
where maincontact=max(maincontact)
or this
select top 1 company, user_id, maincontact
from pt5_user xx
where 0=(select count(*) from pt5_user where company = xx.company and xx.maincontact<maincontact )
good luck !
web/sql...
tdatgod was right, but not totally.
Correct i think it is this:
Select title
from books
where ltrim(rtrim(title)) not like ( '% %' );
Regards
web/sql developer
You could try this:
SELECT
table1.column1,
sum(<very:long_expression1>) bla1,
sum(<very:long_expression2>) bla2,
sum(<very:long_expression2> + <very:long_expression2>) bla3 -- here an error occures
FROM
... several tables ...
WHERE
... several contraints ...
GROUP BY...
...10:23:34
12.08.2002 10:23:34
10.08.2002 10:23:34
08.08.2002 10:23:34
06.08.2002 10:23:34
04.08.2002 10:23:34
02.08.2002 10:23:34
SQL:
select * from a1
where ss<='07.08.2002' and
3>(select count(*) from a1 d
where d.ss<a1.ss)
and i have
SS
06.08.2002 10:23:34
04.08.2002 10:23:34...
U CAN DO THIS ONLY IN YOUR CODE. IT'S NOT REALY AN SQL ISSUE.U NEED TO SAVE IN A VARIABLE THE NAME OF THE university AND WITH AN "IF" U CAN SOLVE YOUR PROBLEM.
:)
gOOD lUcK ! web/sql developer
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.