显示标签为“sub”的博文。显示所有博文
显示标签为“sub”的博文。显示所有博文

2012年3月25日星期日

anyone good with SQL querries?

I have a query that contains a sub query. The problem is that the sub query
returns more than 1 value so it fails with the error (Subquery returned more
than 1 value). Here is a simplified version of how it is setup.
Select * from table1 where column2 = (select col2 from table2 where column 3
=4)
So for the example below it should return rows 1 and 3 from table 1 since a
and c were returned in the subquery.
table 1
col1 col2
1 a
2 b
3 c
table 2
col1 col2 col3
1 a 4
2 b 2
3 c 4
thanks.
Paul G
Software engineer.
On Tue, 30 Jan 2007 16:35:00 -0800, Paul
<Paul@.discussions.microsoft.com> wrote:

>I have a query that contains a sub query. The problem is that the sub query
>returns more than 1 value so it fails with the error (Subquery returned more
>than 1 value). Here is a simplified version of how it is setup.
>Select * from table1 where column2 = (select col2 from table2 where column 3
>=4)
>So for the example below it should return rows 1 and 3 from table 1 since a
>and c were returned in the subquery.
>table 1
>col1 col2
>1 a
>2 b
>3 c
>table 2
>col1 col2 col3
>1 a 4
>2 b 2
>3 c 4
>thanks.
Select * from table1 where column2 in
(select col2 from table2 where column 3 >=4)
J.
|||thanks that is what I was looking for!
Paul G
Software engineer.
"JXStern" wrote:

> On Tue, 30 Jan 2007 16:35:00 -0800, Paul
> <Paul@.discussions.microsoft.com> wrote:
>
> Select * from table1 where column2 in
> (select col2 from table2 where column 3 >=4)
>
> J.
>
>

anyone good with SQL querries?

I have a query that contains a sub query. The problem is that the sub query
returns more than 1 value so it fails with the error (Subquery returned more
than 1 value). Here is a simplified version of how it is setup.
Select * from table1 where column2 = (select col2 from table2 where column 3
=4)
So for the example below it should return rows 1 and 3 from table 1 since a
and c were returned in the subquery.
table 1
col1 col2
1 a
2 b
3 c
table 2
col1 col2 col3
1 a 4
2 b 2
3 c 4
thanks.
--
Paul G
Software engineer.On Tue, 30 Jan 2007 16:35:00 -0800, Paul
<Paul@.discussions.microsoft.com> wrote:
>I have a query that contains a sub query. The problem is that the sub query
>returns more than 1 value so it fails with the error (Subquery returned more
>than 1 value). Here is a simplified version of how it is setup.
>Select * from table1 where column2 = (select col2 from table2 where column 3
>=4)
>So for the example below it should return rows 1 and 3 from table 1 since a
>and c were returned in the subquery.
>table 1
>col1 col2
>1 a
>2 b
>3 c
>table 2
>col1 col2 col3
>1 a 4
>2 b 2
>3 c 4
>thanks.
Select * from table1 where column2 in
(select col2 from table2 where column 3 >=4)
J.|||thanks that is what I was looking for!
--
Paul G
Software engineer.
"JXStern" wrote:
> On Tue, 30 Jan 2007 16:35:00 -0800, Paul
> <Paul@.discussions.microsoft.com> wrote:
> >I have a query that contains a sub query. The problem is that the sub query
> >returns more than 1 value so it fails with the error (Subquery returned more
> >than 1 value). Here is a simplified version of how it is setup.
> >
> >Select * from table1 where column2 = (select col2 from table2 where column 3
> >=4)
> >So for the example below it should return rows 1 and 3 from table 1 since a
> >and c were returned in the subquery.
> >
> >table 1
> >col1 col2
> >1 a
> >2 b
> >3 c
> >
> >table 2
> >col1 col2 col3
> >1 a 4
> >2 b 2
> >3 c 4
> >thanks.
> Select * from table1 where column2 in
> (select col2 from table2 where column 3 >=4)
>
> J.
>
>

anyone good with SQL querries?

I have a query that contains a sub query. The problem is that the sub query
returns more than 1 value so it fails with the error (Subquery returned more
than 1 value). Here is a simplified version of how it is setup.
Select * from table1 where column2 = (select col2 from table2 where column 3
=4)
So for the example below it should return rows 1 and 3 from table 1 since a
and c were returned in the subquery.
table 1
col1 col2
1 a
2 b
3 c
table 2
col1 col2 col3
1 a 4
2 b 2
3 c 4
thanks.
--
Paul G
Software engineer.On Tue, 30 Jan 2007 16:35:00 -0800, Paul
<Paul@.discussions.microsoft.com> wrote:

>I have a query that contains a sub query. The problem is that the sub quer
y
>returns more than 1 value so it fails with the error (Subquery returned mor
e
>than 1 value). Here is a simplified version of how it is setup.
>Select * from table1 where column2 = (select col2 from table2 where column
3
>=4)
>So for the example below it should return rows 1 and 3 from table 1 since a
>and c were returned in the subquery.
>table 1
>col1 col2
>1 a
>2 b
>3 c
>table 2
>col1 col2 col3
>1 a 4
>2 b 2
>3 c 4
>thanks.
Select * from table1 where column2 in
(select col2 from table2 where column 3 >=4)
J.|||thanks that is what I was looking for!
--
Paul G
Software engineer.
"JXStern" wrote:

> On Tue, 30 Jan 2007 16:35:00 -0800, Paul
> <Paul@.discussions.microsoft.com> wrote:
>
> Select * from table1 where column2 in
> (select col2 from table2 where column 3 >=4)
>
> J.
>
>sql

2012年2月25日星期六

any one know whats wrong with it

[CODE]

Private Sub pulllikehell()
Dim cn As SqlCeConnection
Dim rda As SqlCeRemoteDataAccess = Nothing
Dim sqlEngine As SqlCeEngine

Try

' Create database if it doesn't already exist
If (Not File.Exists("\My Documents\ORDER.sdf")) Then
sqlEngine = New SqlCeEngine
sqlEngine.LocalConnectionString = "Data Source=\My Documents\ORDER.sdf;"

sqlEngine.CreateDatabase()
sqlEngine.Dispose()
Else
' Open the connection to the database
cn = New SqlCeConnection("Data Source=\My Documents" & _
"\ORDER.sdf:")
cn.Open()
Dim cmd As SqlCeCommand = cn.CreateCommand()

' Drop the FieldMemos table
cmd.CommandText = "DROP TABLE STAFF"
cmd.ExecuteNonQuery()

' Close the connection

End If

' Instantiate the RDA Object
rda = New SqlCeRemoteDataAccess
' Connection String to the SQL Server.
Dim remoteConnectString As String = "Provider=SQLOLEDB;" & _
"Data Source=KANGALERT/SQLEXPRESS;" & _
"Initial Catalog=ORDER;"

rda.InternetLogin = ""
rda.InternetPassword = ""
rda.InternetUrl = "http://kangalert/server/sqlcesa30.dll"
rda.LocalConnectionString = "Data Source=\My Documents\" & _
"ORDER.sdf;"


rda.Pull("STAFF", "Select * from STAFF", remoteConnectString, _
RdaTrackOption.TrackingOnWithIndexes)
MsgBox("ok")

Catch sqlex As SqlCeException
Dim sqlError As SqlCeError
For Each sqlError In sqlex.Errors
MessageBox.Show(sqlError.Message)
Next
Catch ex As Exception
MessageBox.Show(ex.Message)
Finally
rda.Dispose()
End Try

End Sub

[/CODE]

computer server name is kangalert

and got 2 sqlservice run in my pc, SQLEXPRESS and MSSQLSERVER

DATABASE NAME IS ORDER with a TABLE call STAFF

when come to this statement

rda.LocalConnectionString = "Data Source=\My Documents\ORDER.sdf"

ERROR MESSAGE: A request to send data to the computer running IIS has failed. For more information, see HRESULT.

when come to this statement

rda.Pull("STAFF", "Select * from STAFF", remoteConnectString, _
RdaTrackOption.TrackingOnWithIndexes)

ERROR MESSAGE :A required property is not specified. [ Property name = SubscriberConnectionString ]

HOPEFULLY ANYONE CAN HELP ME SOLVE IT. THANKS IN ADVANCE

its a similar problem on the other thread... have you debugged your codes? if u already did, can you be more specific on the location of the problem...|||

ERROR: A request to send data to the computer running IIS has failed

This occurs when the Client Agent box (Emulator or Device) does not have the network connectivity with IIS Box. Make sure you have the connectivity. Try browsing the above sqlcesa30.dll URL in your emulator/device IE, to ensure the connectivity.

ERROR: A required property is not specified. [ Property name = SubscriberConnectionString ]

I really do not understand how you have got this error.

Let us know the results after resolving the first error.

Thanks,

Laxmi Narsimha Rao ORUGANTI, MSFT, SQL Mobile, Microsoft Corporation