473,396 Members | 2,033 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,396 software developers and data experts.

DOUBT WITH WORKING OF "IN" OPERATOR

102 Expert 100+
Hello friends,
I have a doubt in the working of IN operator. I have a schema by name 'test_schema'. If you look at the following query the expected output is "1", but nothing is displayed.

SELECT 1
FROM TABLE1
WHERE UPPER( 'test_schema' )
IN
(
SELECT UPPER(SCHEMA_NAME)
FROM INFORMATION_SCHEMA.SCHEMATA
)
Please help. Thanks.
May 5 '07 #1
4 1540
pbmods
5,821 Expert 4TB
Hello friends,
I have a doubt in the working of IN operator. I have a schema by name 'test_schema'. If you look at the following query the expected output is "1", but nothing is displayed.

SELECT 1
FROM TABLE1
WHERE UPPER( 'test_schema' )
IN
(
SELECT UPPER(SCHEMA_NAME)
FROM INFORMATION_SCHEMA.SCHEMATA
)
Please help. Thanks.
Is there a 'TEST_SCHEMA' entry in information_schema.schemata.schema_name? If not, MySQL will return an empty set.

Did you mean WHERE UPPER(`test_schema`) instead (note backticks instead of quotes)?
May 5 '07 #2
pradeep kaltari
102 Expert 100+
Thanks for your reply.
Yes there is "test_schema" in information_schema.schemata.schema_name.
By UPPER('test_schema') I meant with single quotes not backticks.
May 7 '07 #3
chandu031
78 Expert
Hi Pradeep,

I tried out your query and it seems the query will not return anything when you use it on System tables. The same query is working fine when used with User tables. I have no idea why this happens. One more interesting thing is that,
while a
SELECT 1 FROM TABLE1 WHERE value IN (Select Column from TABLE1) is not working for system tables, a
SELECT 1 FROM TABLE1 WHERE column IN (Select value from TABLE1) is working. Does anyone know why this is the case in MYSQL?
May 7 '07 #4
pradeep kaltari
102 Expert 100+
Hi Pradeep,

I tried out your query and it seems the query will not return anything when you use it on System tables. The same query is working fine when used with User tables. I have no idea why this happens. One more interesting thing is that,
while a
SELECT 1 FROM TABLE1 WHERE value IN (Select Column from TABLE1) is not working for system tables, a
SELECT 1 FROM TABLE1 WHERE column IN (Select value from TABLE1) is working. Does anyone know why this is the case in MYSQL?
Thanks Chandu.
May 8 '07 #5

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

Similar topics

4
by: RK | last post by:
Hi, In my application, I need to copy data from an Excel file into a SQL table. The article related to this can be found at http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B306572 ...
4
by: Marcin Dobrucki | last post by:
I've been having some problems with a parse error that I can't figure out (PHP 4.3.11 on Solaris9). Sample code: <?php // getting strange parse errors on this class A { var $value; function...
9
by: MSDNAndi | last post by:
Hi, I have a set of simple webservices calls that worked fine using .NET Framework 1.0. I am calling a Java/Apache based webservices, the calling side is not able to supply a proper WSDL. ...
11
by: fourfires.d | last post by:
Dear All, I am new to c++ and when write below code that try to call copy constructor in "=" operator overloading, it can not compile. Can anyone point out for me the reason? thanks !! ...
9
by: Emanuele Aina | last post by:
I have some code which does a lot of "in" on lists containing objects with no __eq__ defined. It all goes fast until I add the __lt__() method: then I have a slowdown comparable to the one I get...
3
by: AnalogKid17 | last post by:
I have the following line of code in my start/login page: document.getElementById("txtLogin").focus(); When I run the website app through F5 (Debug, Start Debugging) it works fine (ie, focus...
2
by: doctorhardik | last post by:
hai all when i try create new file using fopen function in php in "W" mode. it dose not create file. Create test.php file in /var/www/html/ directory on linux machine. past this simple code:...
6
by: Rudi | last post by:
Hello! I'm searching like a similar syntax for if(): int i=5; if (i in ) doSomething; e.g. enum TaskStates {Idle,Proc1,Proc2, ... ProcN}
5
by: tinnews | last post by:
Is there any way in python to say if string1 in string2: <do something> ignoring the case of string1 and string2? I know I could use:-
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
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...
0
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...

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.