473,385 Members | 1,838 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Nested select

Happy friday to all. Those of you in Canada reading this message Happy
Thanksgiving weekend!!

I'm trying to display a bunch of checkboxes in php and have them
checked/not checked based on the results of the following query but
I'm getting syntax errors. This would work in mssql how would I
accomplish the same thing in mysql?

SELECT tblOrg_Type.ID, tblOrg_Type.Org_Type, (Select 'Checked' from
tblContactOrgType where OrgID = 8 AND tblOrg_Type.ID =
tblContactOrgType.OrgTypeID ) AS Checked
FROM tblOrg_Type;

Table Structures:

tblOrg_Type
ID
Org_Type

tblContactOrgType
ID
OrgID
OrgTypeID
Jul 19 '05 #1
0 1370

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Colman | last post by:
Howdy all! I guess I'm a newbie, because I am stumped (or maybe just too durned tired). Here's what I got... CREATE TABLE `nodecat_map` ( `nodecat_id` mediumint(8) unsigned NOT NULL...
0
by: Pascal Délisle | last post by:
Hi! I try to figure out how to use a nested "SELECT" statement after the "IN" predicate. For example, when I try this code, it doesn't return anything although it should: SELECT...
1
by: Grigore Marinescu | last post by:
Hi all, I have the following databasedesign : www.marinescu.dk/databasedesign.pdf which i have a nested SELECT on but i need some more information which i don't know how to retrieve. I have...
3
by: Tcs | last post by:
My backend is DB2 on our AS/400. While I do HAVE DB2 PE for my PC, I haven't loaded it yet. I'm still using MS Access. And no, I don't believe this is an Access question. (But who knows? I...
23
by: Brian | last post by:
Hello All - I am wondering if anyone has any thoughts on which is better from a performance perspective: a nested Select statement or an Inner Join. For example, I could do either of the...
2
by: ask | last post by:
Hi Newsgroup Hipe you can help me, I have a problem with a nested select. I have two tables; one with products and one with prices of these products: product - id, name price - pro_id, price,...
0
by: santoshsri | last post by:
Hi Everyone.. I am new to DB2 .I wish to compare the data of parent query within the nested select statement that is named as Agency. I am getting error SQLSTATE 42601: An unexpected Token...
9
by: P3Eddie | last post by:
Hello all! I don't know if this can even be done, but I'm sure you will either help or suggest another avenue to accomplish the same. My problem may be a simple find duplicates / do something...
2
by: wellhole | last post by:
Hi, I'm trying to use use a sum value from table2 in my nested select, but I can't seem to figure a way to not have to calculate it twice. select a, b, c, d, e, ( select name ...
8
by: modernshoggoth | last post by:
G'day all, thanks in advance for reading. I've got two tables, one that's full of data regularly externally updated called "tblEmployeeLicences": EmployeeID,Name,Licences 1001,Bill,Drivers...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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...

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.