|
In your example, just select where id = 1, 2 or 4.
If you are looking for more complex behaviour, then you need to specify what it is that you are looking for, as we can't divine it from your example.
Arthur Dent - "That would explain it. All my life I've had this strange feeling that there's something big and sinister going on in the world."
Slartibartfast - "No. That's perfectly normal paranoia. Everybody in the universe gets that."
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Acctuly this is my table
id PD_Id Remark
1 1 Good
2 2 Bad
3 2 fair
4 3 Bad
5 3 Good
In this i want the select query for the following result
id PD_Id Remark
1 1 Good
2 2 Bad
4 3 Bad
|
|
|
|
|
Id, PD_ID, Remark are the 3 fields that i have used in this table.
|
|
|
|
|
There is (almost) nothing consistent or special about your desired result set (no specific visible relationship between the value of remark, id , PD_ID).
The resultset can be produced with
"select top 3 id,pd_Id,remark from table where Remark in ('Good','Bad') order by PD_Id ASC"
But that does not seem particularly useful.
|
|
|
|
|
iam having 10 triggers for a table
i want view the triggers
which trigger is firing
is it possible to know
or any system stored prodeure is avaliable in sqlserver 2000
with regards
|
|
|
|
|
In Enterprise Manager, right click on the table and select Manage Triggers. The listbox at the top allows you to view the different triggers - by default it shows the New trigger option.
Arthur Dent - "That would explain it. All my life I've had this strange feeling that there's something big and sinister going on in the world."
Slartibartfast - "No. That's perfectly normal paranoia. Everybody in the universe gets that."
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
This will give you a list of all triggers on a table:
sp_helptrigger[^]
You might want to look at this too:
Using Nested Triggers[^]
--EricDV Sig---------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters
|
|
|
|
|
Hello everyone:
I have a MySQL server running on a linux that is working properly, and i have errors trying to connect to the server on a windows NT client using ODBC. The error i am getting is Can't connect to MySQL 10060. The driver i am using is ODBC 3.51,(i wish to create a vb app using the driver to access the database) I am quite sure that the parameters that i specified for the host name etc are correct. I even downloaded the MySQL control centre to test the connection to the MySQL linux server, but it still doesnt work. I tried using the same ODBC driver and the same windows client to connect to another dummy MySQL server running on a remote windows PC and it works. Also I have a website coded in PHP that can access the MySQL database on any windows pc, so it couldn't possibly be that the MySQL server blocks out my clients IP address right?
Please help Thanks in advance
andy
-- modified at 2:47 Monday 27th November, 2006
|
|
|
|
|
firebow3007 wrote: it couldn't possibly be that the MySQL server blocks out my clients IP address right?
It shouldn't. Sounds like problem on client end...
If you try to write that in English, I might be able to understand more than a fraction of it. - Guffa
|
|
|
|
|
How much expensive openning and closing connection is when connection pool is used ???
Assume I invoke four stored procedures in a page , I open and close the connection for invoking each . How much will it affect the performance of that page ??
calling this in a page :
<br />
Connection.Open();<br />
Connection.Close();<br />
<br />
Connection.Open();<br />
Connection.Close();<br />
<br />
Connection.Open();<br />
Connection.Close();<br />
<br />
Connection.Open();<br />
Connection.Close();<br />
Is it worth replacing it with this. I have made the site like above.It is so hard for me to replace that. What is your suggestion ?
<br />
Connection.Open();<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
Connection.Close();<br />
|
|
|
|
|
I think the first way is acceptable. The close method returns connection to the pool and open method get a freely connection from pool. The second way seems to be a bit better performance but it will charge a lots of cost of changing sources
|
|
|
|
|
Hello All experts,
I am Jayachandra.C, My problem is
I am able to create New User in Oracle database and able to give previleges on sequences, insert, update like. User created. But when i am trying to create a table in the created user table is not creating. Please give me the solution & reason where i failed. please
thank you sir,
Jayachandra.C
-- modified at 4:07 Sunday 3rd December, 2006
|
|
|
|
|
in my project i am using sql server i would like to do normalization how to do help
|
|
|
|
|
|
Based on your varied questions all posted within two days it sure looks like you are asking for homework answers.
____________________________________________________
If at first you don't succeed, skydiving might not be for you.
|
|
|
|
|
I don't have much knowledge in in programming and I need some help with this issue. I am using SQL 2005.
I have a sales table in which I need to compare the difference in sales price of a house. Here is what the data would look like.
ID SalePrice DateSale
2 90000 01/01/94
2 108500 05/12/04
2 115300 09/01/06
45 13500 03/01/54
45 98500 10/01/06
What I need, is a routine that would calulate one sale value from the preceeding for like ID. In the first case, there would be two resulting values calculated 18,500 and 6,800. These values would then be stored in a new table.
I hope I have explained this well.
Dale A. Young
|
|
|
|
|
Can you kindly examplify your input and output?
|
|
|
|
|
The example is simply a home sales table set up this way
ID
DateSale
SaleAmount
The table tracks all the sales that takes place in a community for the homes. A single home can be sold numerous times over its lifespan. So the challenges is to compare one sale amount to the next by date of sale. I need to calculate the difference between each sale and determine the % increase or decrease.
I hope this helps.
Dale A. Young
|
|
|
|
|
Hello,
I have two tables, A like number, value1 value2, and B like number, aktiv, value2, ...
As I want to have all lines of table A, even number does not exist in table B I made a command 'select from A left outer join B on A.number = B.number'
Works fine, but if I try "where B.aktiv != '-1'", the NULL-Values also disapears. I also tried "(where B.aktiv = '1') or (B.aktiv = NULL)" - it doesn't work.
What am I doing wrong?
Thanks, Gerhard
|
|
|
|
|
NULL cannot be compared to any value, so it is neither = -1 of != -1 or even =Null.
If you need to find NULL values you must use IS NULL (Where B.aktiv IS NULL)
NOTE: If you turn the ANSI_NULLS option off, Transact SQL will return comparisons for null,
SEE Books Online for more info.
|
|
|
|
|
It seems that columns having NULL values in B.aktiv is getting eliminated. You can try the following: -
WHERE ISNULL(B.aktiv,1)!='-1'
Let me know if its working for you.
|
|
|
|
|
How Can we prevent SELECT statements from being returned in the dataset , because we may need to execute some SELECT just for other purposes than reporting.
|
|
|
|
|
Just collect the columns being included in the select list in come variables. See below: -
DECLARE @v1 int,@v2 int
SELECT @v1=number1,@v2=number2 FROM tblA
|
|
|
|
|
Hi
im trying to Limit the number of results retrived by a Query so for Example i want to retrive the first 30 and then navigate throw the results 30 by 30.
the problem in my Query that i cant used the TOP 30 command because im Ordering my results with date then status plus alot of ordering.
and this ordering will cause the retrived results to be retrived in a random ID_no order as one of my friends suggested that i use the TOP 30 along with
Where Id no > X Order BY Id_no as in the example below.
but i think if there is no Command in MS Access or that i dont know it because of my lack of knowledge i will have to order by my Where Criteria along with the TOP 30 command.
Another Sol. just popped to my head is to save the results to a Dataset and then using a Table in the Dataset i can just retrived Index based.
i guess i will try the Dataset sollution also if there is any better one plz Help.
By the way im using ODBC COnnection, OdbcCommand and ODBCDatareader.
Thanks in Advance.
Example for Retriving by the TOP and Where command:
1)
Select TOP 30 A.ID_no , .......etc<br />
From A , ......etc<br />
Where A.ID_no > <big>1</big><br />
Order by ID_no ;
2)
Select TOP 30 A.ID_no , .......etc<br />
From A , ......etc<br />
Where A.ID_no > <big>30</big><br />
Order by ID_no ;
and i continue like that.
----------------------------------
Have fun and Stay good
-- modified at 4:14 Saturday 25th November, 2006
|
|
|
|
|
Can you please clarify what is your criteria of retriving the TOP 30 records? Is it that, you want top 30 records as they appear in the table in the order of you primary key column? Is A>ID_no your primary key column? Can you please try the following and let me know: -
SELECT A.ID_no , .......etc
From A , ......etc
Where 30>=(SELECT COUNT(*) FROM A a
WHERE A.ID_no>=a.ID_no)
Order by ID_no,........etc
|
|
|
|