473,748 Members | 10,771 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

getting error in query..

7 New Member
Query gives error : Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression

Query is :
select AlertGroupAssig nment.AlertGrou pAssignmentID,O PCAlert.AlertID ,OPCServer.OPCS erver,OPCItem.O PCItem,OPCAlert .AlertType,OPCA lert.AlertValue ,OPCAlert.Sever ity,OPCAlert.Ac tive,OPCAlert.D escription from OPCAlert,AlertG roupAssignment, OPCItem,OPCServ er where AlertGroupAssig nment.AlertGrou pID=3 and AlertGroupAssig nment.OPCAlertI D!=(select OPCAlertID from AlertGroupAssig nment where AlertGroupID=1) and OPCAlert.AlertI D=AlertGroupAss ignment.OPCAler tID and OPCItem.ItemID= AlertGroupAssig nment.OPCItemID and OPCServer.Serve rID=OPCItem.Ser verID or (OPCAlert.Descr iption like 'dgv' or OPCItem.OPCItem like 'dgv' or OPCServer.OPCSe rver like 'dgv')


I want to return more than 1 value.....Is there any way....

Please help........
Jul 11 '08 #1
2 1264
deepuv04
227 Recognized Expert New Member
Use "NOT IN " instead of " != "

Try the following query

Expand|Select|Wrap|Line Numbers
  1.  
  2. SELECT    AlertGroupAssignment.AlertGroupAssignmentID,OPCAle rt.AlertID,OPCServer.OPCServer,
  3.         OPCItem.OPCItem,OPC Alert.AlertType,OPCAlert.AlertValue,OPCAlert.Sever ity,OPCAlert.Active,
  4.         OPCAlert.Description 
  5. FROM    OPCAlert,
  6.         AlertGroupAssignment,
  7.         OPCItem,
  8.         OPCServer 
  9. WHERE    AlertGroupAssignment.AlertGroupID=3 and 
  10.         AlertGroupAssignment.OPCAlertID NOT IN(SELECT OPCAlertID FROM AlertGroupAssignment WHERE AlertGroupID=1) and 
  11.         OPCAlert.AlertID=AlertGroupAssignment.OPCAlertID and 
  12.         OPCItem.ItemID=AlertGroupAssignment.OPCItemID and 
  13.         OPCServer.ServerID=OPCItem.ServerID or 
  14.         (OPCAlert.Description like 'dgv' or OPCItem.OPCItem like 'dgv' or OPCServer.OPCServer like 'dgv')
  15.  
Jul 11 '08 #2
rajesh0303
7 New Member
Thanks Man....I was breaking my head on this silly thing for an Hour....

Thanks again,....
Jul 11 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
2585
by: James | last post by:
Please help - getting very desperate! Sun, 12 October 2003 05:39 I have PHPDEV 4.2.3 from Firepages.com.au as the upgrade to 4.3.0 did not work. I also had an abortive download from PHP.NET as I could not configure Apache myself. The REAL problem is that PHPmyAdmin works and sees my test database Wines.... But my PHP program does not!
15
2972
by: sara | last post by:
Hi I'm pretty new to Access here (using Access 2000), and appreciate the help and instruction. I gave myself 2.5 hours to research online and help and try to get this one, and I am not getting it. Simple database: I want to have a user enter Supply Orders (just for tracking purposes) by Item. The user may also enter a new item - "new" is a combination of Item, PartNumber and Vendor - they could have the
4
6015
by: Sean Shanny | last post by:
To all, Running into an out of memory error on our data warehouse server. This occurs only with our data from the 'September' section of a large fact table. The exact same query running over data from August or any prior month for that matter works fine which is why this is so weird. Note that June 2004 through today is stored in the same f_pageviews table. Nothing has changed on the server in the last couple of months. I upgraded...
11
5845
by: Jan | last post by:
I'd like a maketable query listing ClientID, and E-mail from another table. This is simple, BUT I'd only like to get only the part after @ in the E-mail. How would this work in MS Access 2003?
1
11216
by: jyoti202 | last post by:
Hi, Need help for this as i have been looking for it but could not get any results. We are using java as front end and DB2 as backend, i m getting the exception while executing a particular query with following error description: DB2 SQL error: SQLCODE: -901, SQLSTATE: 58004, SQLERRMC: sqlno_itr_plan::next :rc( 0) SQLCODE: -901 this error code says "Non severe System error" This query was working fine till...
2
1740
by: sesling | last post by:
Our Database stores event messages in a table called eventnotifications. The table has a message type column. There are two types of messages (alert or info). I have created a form that includes a list box. The list box contains the following (alert, info, both). The ID for each value is hidden from the operator. alert has an ID of 1, info has an ID of 2 and both has an ID of 3. The list box value is passed to a query. The query is...
2
4448
by: srusskinyon | last post by:
I need some help getting unique records from our database! I work for a small non-profit homeless shelter. We keep track of guest information as well as what services we have offered for statistical purposes. I've been using Here's the situation: I have two main tables:
11
1473
by: Armin Zingler | last post by:
"Bill Schanks" <wschanks@gmail.comschrieb Try to execute lvMembers.beginupdate before filling and lvMembers.endupdate
1
4928
by: raghuvendra | last post by:
Hi I have a jsp page with 4 columns: namely Category name , Category order, Input field and a submit button. All these are aligned in a row. And Each Category Name has its corresponding Category order, Input field and a submit button. The Category name is being fetched from the oracle db along with the corresponding Category order. In the corresponding input field (text box) the user enters a new category order which gets stored in...
7
2846
by: Yesurbius | last post by:
I am receiving the following error when attempting to run my query. In my mind - this error should not be happening - its a straight-forward query with a subquery. I am using Access 2003 with all the latest patches. If I do not group the query (ie. remove aggregation) it will work. If I recall, it also works if my subquery does not have joins. I want to accomplish this with pure SQL .. I could easily write a VBA function to handle...
0
8828
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9367
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9319
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9243
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6795
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6073
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3309
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2780
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2213
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.