Author |
Topic |
Kelapa
Starting Member
8 Posts |
Posted - 2013-04-08 : 09:47:51
|
I have a difficulty which tied me up that not to get a decent report from the below issue. As you can see there are some highlighted rows on the screen capture image that shows those rows' data related another table but I can't build a relation with both to pull from another field of that table as T1, T2, T17, T16, T3, T18, T4, T6, T19 and T5 all those field's definitions are in another table. So how can I write a decent script to get those codes' definicition from another table. |
|
TG
Master Smack Fu Yak Hacker
6065 Posts |
Posted - 2013-04-08 : 14:37:54
|
Do you know what table or tables holds the definition to these codes (T18, T4, etc)?You will need to add that table to your FROM clause with the correct correlation to be able to include the definition in your SELECT column list.Be One with the OptimizerTG |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-04-09 : 00:07:55
|
One more thing to note is that you're using Pervasive SQL and this is MS SQL Server forum. So there wont be too many people with exerience in pervasive sql. so you may be better off posting this in some ms sql server forums------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
|
|
Kelapa
Starting Member
8 Posts |
Posted - 2013-04-09 : 03:36:17
|
quote: Originally posted by visakh16 One more thing to note is that you're using Pervasive SQL and this is MS SQL Server forum. So there wont be too many people with exerience in pervasive sql. so you may be better off posting this in some ms sql server forums------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs
Its clear to see that here is a SQL forum as at the top of left corner. Not only MS Sql.Sql is a common language, wink |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-04-09 : 04:10:22
|
quote: Originally posted by Kelapa
quote: Originally posted by visakh16 One more thing to note is that you're using Pervasive SQL and this is MS SQL Server forum. So there wont be too many people with exerience in pervasive sql. so you may be better off posting this in some ms sql server forums------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs
Its clear to see that here is a SQL forum as at the top of left corner. Not only MS Sql.Sql is a common language, wink
Here we deal only with ms sql server. There are very few people (if at all) with experience in Pervasive SQLSo solutions given here cannot be guaranteed to work well in any other RDBMSSQL is common language but implementation has some syntactical difference in various products like Oracle,Teradata, etc------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
|
|
Kelapa
Starting Member
8 Posts |
Posted - 2013-04-10 : 01:03:48
|
quote: Here we deal only with ms sql server. There are very few people (if at all) with experience in Pervasive SQLSo solutions given here cannot be guaranteed to work well in any other RDBMSSQL is common language but implementation has some syntactical difference in various products like Oracle,Teradata, etc
Yes, I'm agree with your words. If I typed my words and the script as MS SQL then nobody sees the difference and might answer to my question. |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-04-10 : 01:11:06
|
quote: Originally posted by Kelapa
quote: Here we deal only with ms sql server. There are very few people (if at all) with experience in Pervasive SQLSo solutions given here cannot be guaranteed to work well in any other RDBMSSQL is common language but implementation has some syntactical difference in various products like Oracle,Teradata, etc
Yes, I'm agree with your words. If I typed my words and the script as MS SQL then nobody sees the difference and might answer to my question.
yep...but you cant still guarantee that given solution will work for you especially if it contains some SQL Server specific syntax.------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
|
|
Kelapa
Starting Member
8 Posts |
Posted - 2013-04-10 : 01:43:06
|
Anyway, I solved my query issue that works well with the below. ThanksSELECT BOMU01T.BOMREC_KAYNAKCODE, IF(IMLT00.AD IS NOT NULL, IMLT00.AD,STOK00.AD), BOMU01T.BOMREC_KAYNAK0, IF(IMLT00.UNITS IS NOT NULL, IMLT00.UNITS, STOK00.IUNIT)FROM BOMU01T LEFT OUTER JOIN STOK00 ON BOMU01T.BOMREC_KAYNAKCODE = STOK00.KOD LEFT OUTER JOIN IMLT00 ON BOMU01T.BOMREC_KAYNAKCODE = IMLT00.KODWHERE BOMU01T.BOMREC_CODE = 'AE 5 17,5 A1 ED 12 3'ORDER BY BOMU01T.SRNUM |
|
|
|