.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Post New Web Links

simple query

Posted By:      Posted Date: October 07, 2010    Points: 0   Category :Sql Server
 

Hi Team,

I am always confused with one simple query

i have get the data which is not in a table B

select *from TableA where col1 in (select col1 from TableB)

how to get the data in tableA which is not in TableB

select *from TableA where col1 not in (select col1 from TableB) why this is not working?

Regards,

Eshwar




View Complete Post


More Related Resource Links

how to create a List order and unourder a simple Sql Query

  
A Simple Query Pass to connection String 1 My Query is SELECT a.HD, a.HEAD, a.SH, a.SUBHEAD, a.TRK, a.TRACK, a.TGT, a.TARGET, a.PDC, a.DT_RELEASE, a.STATUS, a.COFROM V_HIERARCHY1 a   2,My Data is HD    HEAD    SH    SUBHEAD    TRK    TRACK    TGT    TARGET    PDC    DT_RELEASE    STATUS    COHR    HR    Rec    Records    Leave    Leave Records    HRL.0002    Quarterly Review    01.07.2010    04.07.2010    Planned    EdlinkHR    HR1    DB    Database    SAL    Salary    DDS.0001    Calculation of Monthly salary    08.08.2010    09.08.2010    WIP    EdlinkHR    HR    Rec    Records    Ind    Induction Records    HRI.0001    Completion of dossiers.    08.07.2010    10.07.2010    WIP    EdlinkHR    HR  

how to generate an Xml pass Simple query structure like

  
1. My sql query is        SELECT a.HD, a.HEAD, a.SH, a.SUBHEAD, a.TRK, a.TRACK, a.TGT, a.TARGET, a.PDC, a.DT_RELEASE, a.STATUS, a.COFROM V_HIERARCHY1 a2, My Data is HR    HR    Rec    Records    Leave    Leave Records    HRL.0001    Policy and Process for leave record.    27.06.2010    30.06.2010    WIP    EdlinkHR    HR    Rec    Records    Leave    Leave Records    HRL.0002    Quarterly Review    01.07.2010    04.07.2010    Planned    EdlinkHR    HR    DB    Database    SAL    Salary    DDS.0001    Calculation of Monthly salary    08.08.2010    09.08.2010    WIP    EdlinkHR    HR    Rec    Records    Ind    Induction Records    HRI.0001    Completion of dossiers.    08.07.2010    10.07.2010    WIP   &nbs

Issue with one of simple query

  
Hi team, I have a issue in the one of my query select   * from Prod3 where pnumber in (select distinct Policy from prod3_excel) order by pnumber This query gives me 8361 records and there are 8419 records in Prod3 how can i get the remaining records in Prod3 that is 58? select * from Prod3 where pnumber not in (select distinct Policy from prod3_excel) order by pnumber why this is not working? Thanks, Eshwar

need a simple query

  
Hi All, I have a table with multiple rows but I want to select identical rows where createdon (datetime) date is less than one minute different for instance 1 - 299  - 1/9/2010 - 13:30:00 1 - 299  - 1/9/2010 - 13:30:14 Thanks  

Help to write very simple query...

  

How I can write this query ?

I have value = 1000

I wont to get all value from table [MHGROUP].CUSTOM2

from column CPARENT_ALIAS

all values which beginning with num 1000.

SqlCommand

 

cmd2 = new SqlCommand("SELECT * FROM [MHGROUP].CUSTOM2 WHERE CPARENT_ALIAS ='" + value + "'", con2


simple query

  

I need maximum mark scored each students and min mark scored each students.

I have done this way...

select ID,max(mark),min(mark) from table1 group by ID

But i need more field as Class.... I dont want include class field in group by clause

help


Parallel plan for simple query ! Any solutions

  

I am getting a parallel plan for a simple query below. Any workarounds

	UPDATE tblProfile
	SET PlanName = NULL, PlanValue =NULL
	FROM tblProfile pfl
	INNER JOIN tblCustomerPlan ts 
		ON pfl.planID = ts.planID
	WHERE (ts.Name = 'VOID' OR ts.Name = 'IPDC')
	AND ProfileURN = @ProfileURN 


Simple query on a table just hangs ...

  
We have a table that contains parameters for our DW jobs. I can do a "SELECT *" from this table which works fine. However, when we right click and view the "Top n" rows, the interface just hangs with a message "Executing Query. Waiting for response from data source". We have run a DBCC CHECKTABLE command on that table and it ran fine. Any ideas what the issue may be? We have even restarted the SQL Server (2008) and to no effect. We use the "Top n" interface to easily update parameters to run our jobs. Appreciate any help / feedback.
Jagannathan Santhanam

Simple query on a table just hangs ...

  
We have a table that contains parameters for our DW jobs. I can do a "SELECT *" from this table which works fine. However, when we right click and view the "Top n" rows, the interface just hangs with a message "Executing Query. Waiting for response from data source". We have run a DBCC CHECKTABLE command on that table and it ran fine. Any ideas what the issue may be? We have even restarted the SQL Server (2008) and to no effect. We use the "Top n" interface to easily update parameters to run our jobs. Appreciate any help / feedback.
Jagannathan Santhanam

Simple CAML query without Time in the date

  

Hi,

I have written following CAML query.

string.Format("<OrderBy><FieldRef Name='Title' Ascending='False' />

<FieldRef Name='Priority' Ascending='False' />

<FieldRef Name='Status' Ascending='False' />

<FieldRef Name='PercentComplete' Ascending='False' /><FieldRef Name='AssignedTo' Ascending='False' /><FieldRef Name='TaskGroup' Ascending='False' /><FieldRef Name='Body' Ascending='False' /><FieldRef Name='StartDate' Ascending='False' />

Problem with simple query

  

Hello,

I have a problem with a query. I want to check the field confirm_date if it contains a value or null. If it contains a value I want to do an insert statement.

The query looks like so,

select

 


case confirm_date
when is not null

MDX simple query doesnt show the years in the rows but shows (all) with value

  

Hi,

 

this mdx script should return asset value for the individual years but instead it return one line with a value.

When i use the browser in ssas and select the year in rows and measure, it gives the result back as expected ie. years in the rows and values.

Can you help me out please im stuck here:

 

 

SELECT

      [Measures].[Appraisal Forecasted Value] ON COLUMNS,

     [Asset Value Date].[Year] ON ROWS

FROM [CMSX_DWH_OLAP_AssetExposure]

// Result:

 

// Appraisal Forecasted Value

//All 1,931,290,000  I miss the Years on rows?

 

 

// This is from the browser which is correct because the year is added


Year Appraisal Forecasted Value

2000

2001

2002

2003

2004

2005

2006

2007

MS SQL Server: Search All Tables, Columns & Rows For Data or Keyword Query

  
If you need to search your entire database for specific data, this query will come in handy.

So when a client needs a custom report or some sort of custom development using Great Plains, most of the time I will have to track down the data in the system by running this query and find the table(s) it is in.

Creating a Simple Class in C#

  
The second article in the C# Object-Oriented Programming tutorial describes how classes are created in C# and how behaviour, in the form of publicly visible and private, hidden methods can be added. This demonstrates some of the uses of encapsulation

A Simple and Extensible Radio Button Style GridView

  
The GridView is one of the significant controls in ASP.NET 2.0 and later versions. No doubt it reduces a lot of work time. However, customizing the GridView control is not an easy task. For example, it's hard to add a radio button column to the GridView. This article demonstrates the reason why a radio button column cannot act as normal and how to create a simple and extensible radio button GridView.

How to Encrypt Query String Parameters in ASP.NET

  
Encrypt Query String Parameters in ASP.NET.u can send secure data one page another page u can also use query string to encrypt

Silverlight Simple Animation

  
Silverlight has several built in techniques for animating controls. Many of these technologies are particularly useful for creating simple animations meant to decorate a web page with eye catching movement that draws the reader's attention. In this post I will skip over these decorative technologies, and instead show how to create a simple animation using a technique similar to those used in many games.
Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend