Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
sqlnewbie82
Starting Member
11 Posts |
Posted - 2007-10-22 : 04:40:25
|
| HIi am getting a error with my sql statement. i am trying to join to two tables together. this is the error it is giving.Syntax error (missing operator) in query expression '12Package_Listing.Package_id LIKE 11Package.Package_id'.my sql statement isstring strSQL1 = "select * from 12Package_Listing INNER JOIN 11Package ON 12Package_Listing.Package_id LIKE 11Package.Package_id"; |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-10-22 : 04:51:17
|
select * from [12Package_Listing] INNER JOIN [11Package] ON [12Package_Listing].Package_id LIKE [11Package].Package_id KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-10-22 : 06:32:31
|
| Also like Without % doesnt make any senseMadhivananFailing to plan is Planning to fail |
 |
|
|
sqlnewbie82
Starting Member
11 Posts |
Posted - 2007-10-22 : 07:04:15
|
| hi thanks for the input. that sql statement seems to work, but i have problem. i am trying to display package name which is stored in the 11Package table. but i am getting an error. i can only display the package idshelp |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-10-22 : 08:14:49
|
quote: Originally posted by sqlnewbie82 hi thanks for the input. that sql statement seems to work, but i have problem. i am trying to display package name which is stored in the 11Package table. but i am getting an error. i can only display the package idshelp
What is the error?MadhivananFailing to plan is Planning to fail |
 |
|
|
sqlnewbie82
Starting Member
11 Posts |
Posted - 2007-10-22 : 08:39:22
|
| i am getting this errorSyntax error. in query expression '(select Package_name from 11Package where 11Package.Package_id = 12Package_Listing.Package_id)'this is my sql queryselect * , (select Package_name from 11Package where 11Package.Package_id = 12Package_Listing.Package_id) as Package_name from 12Package_Listingregards |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-10-22 : 08:45:35
|
| You need to use braces around table names as Tan suggestedMadhivananFailing to plan is Planning to fail |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
|
|
|
|
|