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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Select a certian Field

Author  Topic 

stagger43
Starting Member

4 Posts

Posted - 2011-12-07 : 12:44:06
SELECT
PMEQMT.EPLANT_ID

Inside the table PMEQMT.EPLANT_ID we have two EPLANTS_ID's 1 and 2

All I need to do is to choose a certain Eplant_id 1 or 2
I tried SELECT PMEQMT.EPLANT_ID = '2' but my SQL checker gave me an error that didn’t help me. I am sure this is basic; I am new to SQL kinda sorta... Thx for any and help!!

Mathew
www.AutismMx.org

the complete code
SELECT
SUBSTR("PMEQMT"."EQNO",1,10) EQNO,
"PMEQMT"."CLASS",
ROUND("PMJOB"."TOTAL_UNITS",0) ACTUAL,
SUBSTR("PMJOB"."UOM",1,8) UOM,
SUBSTR("PMJOB"."ACT_EVERY",1,10) PLANNED,
SUBSTR("PMTASKS"."DESCRIP",1,60) TASK_DESC,
ROUND((("PMJOB"."TOTAL_UNITS"/"PMJOB"."ACT_EVERY")*100),0) PERCENTAGE,
PMEQMT.EPLANT_ID
FROM
"IQMS"."PMEQMT" "PMEQMT",
"IQMS"."PMJOB" "PMJOB",
"IQMS"."PMTASKS" "PMTASKS"
WHERE
"PMEQMT"."ID" = "PMJOB"."PMEQMT_ID"(+) AND
"PMJOB"."PMTASKS_ID" = "PMTASKS"."ID"(+) AND
("PMEQMT".PK_HIDE IS NULL OR
"PMEQMT"."PK_HIDE" = 'N') AND
("PMEQMT"."CLASS" = 'MT' or "PMEQMT"."CLASS" = 'TL') AND
("PMJOB"."TOTAL_UNITS"/"PMJOB"."ACT_EVERY")>.9 and
("PMJOB"."TOTAL_UNITS"/"PMJOB"."ACT_EVERY")<1.
ORDER BY
PMEQMT.EQNO ASC,
PMTASKS.DESCRIP ASC

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-12-07 : 13:42:10
i dont think this is ms sql server. please post in relevant forums if its not t-sql code

this is ms sql forum and we provide mostly t-sql specific solution

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

stagger43
Starting Member

4 Posts

Posted - 2011-12-07 : 13:45:25
Well I figured out that I cant make the choice in the SELECT part of the code. I am assuming my choice of a certain EPLANT would be in the WHERE part of the code. Am I getting closer???
Go to Top of Page

stagger43
Starting Member

4 Posts

Posted - 2011-12-07 : 14:00:30
Its a Oracle DB, any idea what SQL I am using?!?!?
thx!
quote:
Originally posted by visakh16

i dont think this is ms sql server. please post in relevant forums if its not t-sql code

this is ms sql forum and we provide mostly t-sql specific solution

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/



Go to Top of Page

jimf
Master Smack Fu Yak Hacker

2875 Posts

Posted - 2011-12-07 : 14:27:13
Oracle uses PL/SQL. www.dbforums.com may be more helpful to you.

Jim

Everyday I learn something that somebody else already knew
Go to Top of Page

stagger43
Starting Member

4 Posts

Posted - 2011-12-07 : 16:54:36
Thx Jim! I will head that way!
Go to Top of Page
   

- Advertisement -