Where clause on one column out of two
I have a where clause filtering out data from the sum(workhour) column. I want to return another column beside it that does not filter workhour and a third column that filters workhour based on a different criteria. Is this possible?
sql
select activity_exit_date.year_id, activity_exit_date.month_id, locked_by, round(sum(workhour*60),1) as 'Maker/Checker Time'
from activity_exit_date
right join (project_name right join time_tracking on project_name.projectname_id=time_tracking.projectname_id)
on Activity_Exit_Date.Activity_Exit_Date=time_tracking.Activity_Exit_Date
where projectname like '%Maker%'
group by activity_exit_date.year_id, activity_exit_date.month_id, locked_by
year month locked_by maker/checker
2 2.0 aa93971 9316.2
2 2.0 ab41741 330.0
2 2.0 ab48799 8068.8
2 2.0 ag27219 7230.0
2 2.0 ah96254 7216.2
2 2.0 ah96763 6180.0
2 2.0 aj58427 1170.0
2 2.0 ak27324 7596.0
2 2.0 am37564 2790.0
2 2.0 ar04163 9885.0
2 2.0 as03789 9492.0
2 2.0 av04089 4854.0
2 2.0 aw03010 10056.6
thanks!
J
Hi,
Conditions in the WHERE clause affect the entire result set.
If you want certain conitions only to apply to certain columns, then put the condition in a CASE expression.
For example:
SELECT deptno
, COUNT (*) AS total_cnt
, COUNT ( CASE
WHEN job = 'CLERK'
THEN 1
END
) AS clerk_count
, COUNT ( CASE
WHEN sal > 1000
THEN 1
END
) AS sal_1000_cnt
FROM scott.emp
GROUP BY deptno;Output:
DEPTNO TOTAL_CNT CLERK_COUNT SAL_1000_CNT
30 6 1 5
20 5 2 4
10 3 1 3Note that these are the same numbers we would get by running these queries separately:
SELECT deptno, COUNT (*) FROM scott.emp GROUP BY deptno;
SELECT deptno, COUNT (*) FROM scott.emp WHERE job = 'CLERK' GROUP BY deptno;
SELECT deptno, COUNT (*) FROM scott.emp WHERE sal > 1000 GROUP BY deptno;
I hope this answers your question.
If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables involved, and also post the results you want from that data.
Explain, using specific examples, how you get those results from that data.
Always say which version of Oracle you're using (e.g., 11.2.0.2.0).
See the forum FAQ {message:id=9360002}
Similar Messages
-
JTable - One Column Heading for Two Columns
Can you adjust the default JTable to have one column heading for two columns of data? Is there a simple span command? I've looked at the api for JTable and JTableHeader and didn't see anything, is there something I'm missing? Any help would be appreciated.
What i am trying to accomplish is have column 'E' span 2 columns.
This is my code thus far, however it give the error from my pryor message. I am pretty sure it is because I'm using and Object[][] and a String[] instead of Vectors. What corrections do I need to make in order for my goal of:
[ A ][ B ][ C ][ D ][ E ][ F ][ G ]
[ 1 ][ 2 ][ 3 ][ 4 ][5][6][ 7 ][ 8 ]
Object[][] data = new Object[ROWS][COLUMNS];
String[] columnNames = {"A","B","C","D","E","E","F","G"};
table = new JTable(data, columnNames);
table.setBackground(Color.white);
table.addKeyListener(this);
DefaultTableCellRenderer d = new DefaultTableCellRenderer();
d.setHorizontalAlignment(JLabel.CENTER);
table.setDefaultRenderer(table.getColumnClass(0),d);
for (int i = 0; i < table.getColumnCount(); i++){
TableColumn aColumn = header.getColumnModel().getColumn(i);
TableCellRenderer renderer = aColumn.getHeaderRenderer();
if (renderer == null) {
renderer = new DefaultTableCellRenderer(){
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column){
JTableHeader header = table.getTableHeader();
if (header != null) {
setForeground(header.getForeground());
setBackground(header.getBackground());
setFont(header.getFont());
setHorizontalAlignment(JLabel.CENTER);
setText((value == null) ? "" : value.toString());
setBorder(UIManager.getBorder("TableHeader.cellBorder"));
return this;
aColumn.setHeaderRenderer(renderer); -
Use value from tabular form column in the LOV where clause of another column
Hi
Using APEX 4.2 on 11g
In a tabular form I want to filter the values in a Popup Key LOV based on the value of another column (same row).
i.e. I want to get the value of one column and use it in the where clause for the Popup LOV on the same row.
e.g. where COL 2 is a popup LOV
COL 1
COL 2
1
LOV SQL: SELECT a FROM b WHERE c = <value from COL 1>
2
LOV SQL: SELECT a FROM b WHERE c = <value from COL 1>
3
LOV SQL: SELECT a FROM b WHERE c = <value from COL 1>
The value in COL 1 does not change once the row is created. It is a hidden ID field.
Is this possible?
NickAnyone have any ideas?
I thought getting the value from one column and using it in another column would be commonly used functionality... I just can't seem to work it out. -
TopLink essentials: extra where clause for one to many relationship?
We have a lot of tables that contain "historic" records. Those are marked by a column "historic" holding a value "Y". Sometimes we are not interested in historic values. For example in the next case:
@Entity
@Table(name="ART")
public class Article {
@OneToMany(mappedBy="article", cascade=CascadeType.ALL, fetch=FetchType.LAZY)
private Collection<ArticleStats> arcItems;
public Collection<ArticleStats> getArticleStats() {
return arcItems;
}One article can have multiple "stats". We are in this case only interested in the "stats" of this article that are not historic. In SQL terms, I would like to add an extra where clause: "WHERE historic = 'N'".
Of course inheritance (with discriminators) is an option, but I don't prefer that. We have a lot of relationships like this and using inheritance would mean we have to add a lot of extra classes. Is there a way to add an extra where clause to the query that is used to retrieve all the stats records related tot my Article?
We use TopLink essentials with an IBM AS/400 database.The JPA Spec does not handle this case, but TopLink Essentials does. You will need to customize your TopLink descriptor using a DescriptorCustomizer. You can set your DescriptorCustomizer in your persistence.xml using the "toplink.descriptor.customizer.<entity-name>" property set to the class name "<package>.<class>" of your customizer class.
The customizer would look something like:
public class MyCustomizer implements DescriptorCustomizer {
public void customize(ClassDescriptor descriptor) {
OneToManyMapping mapping = (OneToManyMapping )descriptor.getMappingForAttributeName("arcItems");
ExpressionBuilder builder = new ExpressionBuilder();
mapping.setSelectionCriteria(builder.getField("STAT.ART_ID").equal(builder.getParameter("ART.ID").and(builder.getField("HISTORY").equal("N")));
If you never wanted historical records you could also add this expression to your descriptor's additionalJoinExpression.
James Sutherland -
How to block one invoice out of two in APP
Gurus,
For one vendor 2 invoices are due. because of some reasons, I don't want to pay one invoice out of that. so it should not pickup in APP. How to block a particular invoice.Hi
In APP after you run the Payment Proposal , payment proposal will be created.
select Edit proposal button , you will see the 2 invoices.
double click on the amount and again double click on the document which you do not want to pay.
give payment block : A and enter and save.
now you select schedule payment run , payment for only 1 invoice will be paid.
here you will see 1 posting order generated & completed.
Regards
Venkat -
Does Aperture have layers like in Photoshop? I have to make 1 photo out of two. This is an assignment for the Fotovakschool.
As Alan pointed out Aperture does not do layers. While the plugin he pointed to seems interesting (had never seen it before) it is on the pricey side for what it does.
You could use either GIMP - The GNU Image Manipulation Program which is free or else Pixelmator from the Mac App Store for $30, as Apertures external editor. In either case you'll get a app that will do more for you then just layers.
regards -
Where clause in COUNT function and joining two queries
I have a table that I am trying to count the number of course passed, and also list the modules passed as well.
the first problem I am having is what to put in the where variable , so that its not specific to a customer(I can use the query below for a particular customer and a particular course)but I will like a generic query where the result will be distinct in terms
of user and course like the one below
select FirstName,LastName,CourseTitle,Noofmodules, count (Coursecompleted) as modulescompleted from EStudentsprogress where Coursecompleted = '1'and EmailAddress = '[email protected]'
and CourseTitle = 'Microsoft MOS 2010 EXCEL' Group by FirstName, LastName, CourseTitle, Noofmodules ;
How can i make it list the result as above, whereby i dont specify the email address or course title(trying to get the result for all the clients )
. Also I have a query that list the courses that is passed by the customer, I will like the column with the list of courses passed be added to the result above, but as a column for each course.
select FirstName,LastName,CourseTitle, EmailAddress, CourseModule as coursepassed from EStudentsprogress where coursecompleted =1
cheersDo you mean this?
select FirstName,
LastName,
CourseTitle,
Noofmodules,
count (Coursecompleted) as modulescompleted,
STUFF((SELECT ',' + CourseTitle
FROM EStudentsprogress
WHERE FirstName = e.FirstName
AND LastName = e.LastName
WHERE Coursecompleted = '1'
FOR XML PATH('')),1,1,'') AS CoursesCompleted
from EStudentsprogress e
where Coursecompleted = '1'
Group by FirstName, LastName, CourseTitle, Noofmodules ;
If not please provide some sample data and explain the output you want
Please Mark This As Answer if it solved your issue
Please Mark This As Helpful if it helps to solve your issue
Visakh
My MSDN Page
My Personal Blog
My Facebook Page
I AM HAVING Incorrect syntax near the keyword 'WHERE'.
It was a typo
try this
select FirstName,
LastName,
CourseTitle,
Noofmodules,
count (Coursecompleted) as modulescompleted,
STUFF((SELECT ',' + CourseTitle
FROM EStudentsprogress
WHERE FirstName = e.FirstName
AND LastName = e.LastName
AND Coursecompleted = '1'
FOR XML PATH('')),1,1,'') AS CoursesCompleted
from EStudentsprogress e
where Coursecompleted = '1'
Group by FirstName, LastName, CourseTitle, Noofmodules ;
Please Mark This As Answer if it solved your issue
Please Mark This As Helpful if it helps to solve your issue
Visakh
My MSDN Page
My Personal Blog
My Facebook Page
its populating all the result for a particular customer, so i added another clause to it and it worked
select FirstName,
LastName,
CourseTitle,
Noofmodules,
count (Coursecompleted) as modulescompleted,
STUFF((SELECT ',' + CourseTitle
FROM EStudentsprogress
WHERE FirstName = e.FirstName
AND LastName = e.LastName
AND Coursecompleted = '1'
AND CourseTitle = e.CourseTitle
FOR XML PATH('')),1,1,'') AS CoursesCompleted
from EStudentsprogress e
where Coursecompleted = '1'
Group by FirstName, LastName, CourseTitle, Noofmodules ;
but the result of the column is long , so i tried to used the course module, which is a column with numbers, and i tried modifying the query , but i had Error converting data type varchar to float.( i checked and saw that stuff is for concatinating
strings) is there a way around it.
i used
select FirstName,
LastName,
CourseModule,
CourseTitle,
Noofmodules,
count (Coursecompleted) as modulescompleted,
STUFF((SELECT ',' + CourseModule
FROM EStudentsprogress
WHERE FirstName = e.FirstName
AND LastName = e.LastName
AND Coursecompleted = '1'
AND CourseTitle = e.CourseTitle
FOR XML PATH('')),1,1,'') AS CoursesCompleted
from EStudentsprogress e
where Coursecompleted = '1'
Group by FirstName, LastName,CourseModule, CourseTitle, Noofmodules ; -
Split one column value into two columns using t-sql
Hi All,
I have one varchar column in a table.
Col1
ABC-12C4
BC-A345
CD
XYZ
How to split this into two columns like this using t-sql
Col1 Col2
ABC 12C4
BC A345
CD
XYZ
Thanks,
RH
sqlassuming a static delimiter, and the split will end up with a max of 2 columns, something like this would work. basically you just need to determine where the delimiter is, and then use the left and right functions to find the 2 pieces.
declare @t table(value varchar(10))
insert into @t(value)
values
('ABC-12C4'), ('BC-A345'), ('CD'), ('XYZ')
select
case
when charindex('-', value) != 0 then left(value, charindex('-', value) - 1)
else value
end as col1,
case
when charindex('-', value) != 0 then right(value, len(value) - charindex('-', value))
else ''
end as col2
from @t -
How to delete one record out the two?
Hi all,
A have an Orders table:
ACCOUNT, ORDER_NO, ORDER_DATE
I have a few cases where there two accounts have the same ORDER_NO. I dont think this is right in a traditional Orders/ Orderline relationship!
For Example:
ACCOUNT ORDER_NO ORDER_DATE
WYM01 O15506 01/09/2004
DA4060 O15506 01/09/2004
What is the best way to delete one of these? There are quiet a few so I was looking into cursors.
ThanksYou can do it like this
DELETE
FROM orders
WHERE ROWID IN ( SELECT row_id
FROM (SELECT ROWID row_id
,ROW_NUMBER () OVER ( PARTITION BY order_no
ORDER BY ROWID
) row_num
FROM orders
WHERE row_num <> 1
);Regards
Arun -
One (NTFS) out of two partitions on a WD 1TB external won't mount after improper ejection
I've got a 1tb external WD My Passport hard drive that I have formatted into two partitions (One FAT32 that carries a bootable Windows 7 install for bootcamp and the like, one NTFS that holds all of my movies and TV shows). Originally, I set my MBP up to read/write to the NTFS partition via the method in this link: http://http://reviews.cnet.com/8301-13727_7-57588773-263/how-to-manually-enable- ntfs-read-and-write-in-os-x/. Everything was peachy; I could get onto that partition on my Bootcamped Windows and on OS X both.
So I took my trusty media library with me to Afghanistan. Seeing as I don't have a lot of options to back up all that data, whenever I wanted to watch something I would get my HD out of its safe place in my backpack, copy the file onto my MBP, replace my HD back in its sanctuary, and watch straight off of my computer.
This time, though, since I was only watching one 20-minute episode of Batman Beyond before I got in the shower while I drank my post-workout shake, I didn't bother with my safe method. SURE ENOUGH, in the middle of the episode, I knock my HD straight off of my bunk, it falls off of the cable, and lands on the floor.
My first thought was that I might have broken an armature or dislodged the spindle/platter assembly. However, the drive spins up fine, doesn't make any noise, and the vibration in it feels normal. Also, I can still see the my FAT32 partition like so: http://i.imgur.com/S0rF0wK.jpg
I can also see my old partition in Disk Utility, but can't manually mount it: http://i.imgur.com/A44Ld4P.jpg (indeed, my name is Forrest)
Nor can I mount it manually through Terminal diskutil commands, but I think I may not be doing this right: http://i.imgur.com/fx3H9QH.jpg
I realize that I may have corrupted something and that my last option might be to erase/reformat, but I would REALLY prefer not to go down that road right now; I barely have Internet much less the ability to repopulate a media library.
I tried:
-restarting my computer (of course)
-dismounting/remounting HD
-sighing heavily
-viewing the HD from Windows (which sees the FAT32, and sees a drive letter for the NTFS but won't read it, just hangs when I try to access it)
-using chkdsk from Windows (get error that I need to be running in an "elevated mode" for that operation, which is something else I'll be addressing soon)
-cursing
-mounting manually with Terminal commands (see above)
-coming here to beg the gods' forgiveness and hopefully get advice
Tell me how to fix this and keep all of my movies and TV shows and I will owe you one (1) undying gratitude.Hi Kool G4. I think that I'll take a trip to Tek Serve tomorrow and see what they can do. I was hoping for the same luck I had with the internal one re-appearing, but so far nothing.
I guess that every once in a while when something is improperly ejected, the warning is valid. There have been so many improper ejections (not on this drive) that have not resulted in a failed drive. My luck, and on my very important drive. Bummer.
But thanks to all of you for offering your wisdom.
I'm going to leave it overnight plugged in just in case it's just a slow startup issue. *crossing fingers*
Otherwise, I do hope that a specialist can recover the data. -
Replacing one column value between two rows..help??
HI,
I have table T
it has five columns, all are in number data type
Col1 and col2 are jointly primary key i.e. they cannot be repeated combined
when i run this query..
SQL> Select * from t
it shows me the data like this
Col1 Col2 Col3 Col4 Col5
1 1 78 58 12.76
2 1 128 446 32.10
3 1 468 566 52.10
4 1 878 58 52.05
5 1 987 348 22.02
... so on.
my requirement is that i want to update this table by replacing the col1 value between any two rows
suppose this is the first row
Col1 Col2 Col3 Col4 Col5
1 1 78 58 12.76
and this is any 2nd row
Col1 Col2 Col3 Col4 Col5
5 1 987 348 22.02
now i want that for first row the value of col1 replaces the value of col1 of 2nd row
and for 2nd row the value of col1 replaces the value of col1 of 1st row
i.e.
Col1 Col2 Col3 Col4 Col5
5 1 78 58 12.76
Col1 Col2 Col3 Col4 Col5
1 1 987 348 22.02
please tell how to achieve this in single query/procedureregards,
RamisSQL> create table t (id1 number, id2 number, name varchar2(1));
Table created.
SQL> alter table t add primary key (id1,id2);
Table altered.
SQL> insert into t values(1,1,'A');
1 row created.
SQL> insert into t values(5,1,'B');
1 row created.
SQL> commit;
Commit complete.
SQL> select * from t;
ID1 ID2 N
1 1 A
5 1 B
SQL> var val1 number
SQL> var val2 number
SQL> exec :val1 := 1;
PL/SQL procedure successfully completed.
SQL> exec :val2 := 5;
PL/SQL procedure successfully completed.
SQL> update t set id1 = (:val1 + :val2) - id1 where id1 in (:val1,:val2);
2 rows updated.
SQL> select * from t;
ID1 ID2 N
5 1 A
1 1 B
SQL> rollback;
Rollback complete.
SQL> select * from t;
ID1 ID2 N
1 1 A
5 1 B
SQL> commit;
Commit complete.
SQL> update t set id1 = decode(id1,:val1,:val2,:val1)
2 where id1 in (:val1, :val2);
2 rows updated.
SQL> select * from t;
ID1 ID2 N
5 1 A
1 1 BRgds. -
Combining Sum/Case queries with different where clauses into one query
Hello,
I'm trying to combine 2 queries that contain the SUM/CASE function into one query that'll produce the output in the same table, rather than having two The thing is, the two queries have different conditions. I've created a sample data table and outputs to better describe what I'm trying to achieve.
SAMPLE_DATA
DEPT
PROD_CODE
FLAG1
FLAG2
HO
A
NULL
Y
HO
B
NULL
Y
HO
A
Y
NULL
HO
B
Y
Y
IT
A
NULL
Y
IT
C
NULL
NULL
ENG
B
NULL
Y
ENG
C
NULL
Y
ENG
C
Y
Y
MKT
A
Y
Y
The first query I'm running is to sum the product codes department wise while checking if FLAG1 is Y. The second query is checking if FLAG2 is Y.
First Query:
select DEPT, sum(case PRODUCT_CODE when 'A' then 1 else 0 end),
sum(case PRODUCT_CODE when 'B' then 1 else 0 end),
sum(case PRODUCT_CODE when 'C' then 1 else 0 end)
from SAMPLE_DATA where FLAG1 is not null group by DEPT;
Second Query:
select DEPT, sum(case PRODUCT_CODE when 'A' then 1 else 0 end),
sum(case PRODUCT_CODE when 'B' then 1 else 0 end),
sum(case PRODUCT_CODE when 'C' then 1 else 0 end)
from SAMPLE_DATA where FLAG2 is not null group by DEPT;
FIRST QUERY OUTPUT:
DEPT
PRODA_FL1
PRODB_FL1
PRODC_FL1
HO
1
1
0
IT
0
0
0
ENG
0
0
1
MKT
1
0
0
SECOND QUERY OUTPUT:
DEPT
PRODA_FL2
PRODB_FL2
PRODC_FL2
HO
1
2
0
IT
1
0
0
ENG
0
1
2
MKT
1
0
0
My aim is to combine both the queries so that the output is displayed the same way as the table below.
DESIRED OUTPUT:
DEPT
PRODA_FL1
PRODB_FL1
PRODC_FL1
PRODA_FL2
PRODB_FL2
PRODC_FL2
Any help or tips will be greatly appreciated. Please note I'm working with more complex data and have simplified my question just to understand how to solve this.Just treat the two queries as tables, join them on DEPT and produce the results you want.
with q1 as (
select DEPT, sum(case PRODUCT_CODE when 'A' then 1 else 0 end) PRODA_FL1,
sum(case PRODUCT_CODE when 'B' then 1 else 0 end) PRODB_FL1,
sum(case PRODUCT_CODE when 'C' then 1 else 0 end) PRODC_FL1
from SAMPLE_DATA where FLAG1 is not null group by DEPT),
q2 as (
select DEPT, sum(case PRODUCT_CODE when 'A' then 1 else 0 end) PRODA_FL2,
sum(case PRODUCT_CODE when 'B' then 1 else 0 end) PRODB_FL2,
sum(case PRODUCT_CODE when 'C' then 1 else 0 end) PRODC_FL2
from SAMPLE_DATA where FLAG2 is not null group by DEPT;
select q1.dept, proda_fl1, prodb_fl1, prodc_fl1, proda_fl2, prodb_fl2, prodc_fl2
from q1, q2
where q1.dept = q2.dept -
Summary column with where clause
Hi all,
I'm using Oracle Report Builder 10GR2. I have the following issue: In one of the query i have the following result :
Suppliers 0
Suppliers 1408
Total in BGN 1408
Customers 6024
Customers 11779.32
Customers
Total in BGN 11779.32
Taxes 0
Taxes 0
Total in BGN 0
Cash 1363.85
Cash 691
Cash 991.23
Cash 688
Total in BGN 2355.08I want to make a sum for these columns where corresponds to description " Total in BGN" . Maybe it is a simple task... Do i have a chance to select from a query in a Report Builder?
If yes, pls specify? Or maybe there is a chance to add a where clause for summary column. But keep in mind that this is one of the queries in the report builder and i have to add summary with this conditions. I cannot change the existing query but probably add a new one.
Any ideas?
DB Version: 11g
Thanks in advance,
Bahchevanov.
Edited by: bahchevanov on Sep 29, 2012 2:21 AMHello,
You should use parameter file.Another question i can see you are using 11g.Why don't you use data pump?.
Data Pump is faster and have more features and enhancement than regular imp and exp.
You can do the following:
sqlplus / as sysdba
Create directory DPUMP_DIR3 for 'Type here your os path that you want to export to';then touch a file:
touch par.txt
In this file type the following the following :
tables=schema.table_name
dumpfile=yourdump.dmp
DIRECTORY=DPUMP_DIR3
logfile=Your_logfile.log
QUERY =abs.texp:"where hiredate>'01-JAN-13' "then do the following
expdp username/password parfile='par.txt'
If you will import from Oracle 11g to version 10g then you have to addthe parameter "version=10" to the parameter file above
BR
Mohamed ELAzab
http://mohamedelazab.blogspot.com/ -
WHERE clause creating a join for two or more tables
The CS3 Dreamweaver book says that the WHERE clause can
create a join for two or more tables. The join was created, but the
data is repeating. I have searched the web and this forum and have
not found the answer.
My Master page filters the recordset by Style No and when a
customer clicks on a particular style, it sends him to the Detail
page. All the records are showing from all tables on the detail
page from the Dynamic List, except they are showing multiple times
(ex. Size table has 4 sizes and Color table has 2 colors - my Size
Drop Down list is showing 8 options and my Color Drop Down List is
showing 8 options) I have a Master Page with a recordset pointing
to a Detail Page using the same recordset.
Master page works perfectly.
Master Recordset SQL:
SELECT products.itemID, products.category, products.styleno,
products.name, products.description, products.ourprice,
products.imageTH, products.image, coloroption.color,
sizeoption.size
FROM products, coloroption, sizeoption
WHERE category = 'chefcoats' AND
products.styleno=sizeoption.styleno AND
products.styleno=coloroption.styleno
GROUP BY products.styleno
ORDER BY styleno ASC
The Detail Recordset:
SELECT products.itemID, products.category, products.styleno,
products.name, products.description, products.ourprice,
products.imageTH, products.image, sizeoption.size,
coloroption.color
FROM products, sizeoption, coloroption
WHERE itemID=colname AND products.styleno=sizeoption.styleno
AND products.styleno=coloroption.styleno
I tried using the GROUP BY on the detail page, but then it
only showed one size and color from the dynamic drop down list. I
tried changing the field name "styleno" in the other tables to be
unique, however, I was using the table identifer. I tried using the
JOIN command instead of the WHERE clause and that didn't help
either.
On the detail page, the customer is supposed to click on the
Size box and see sizes XSM - 6XL ONLY ONE TIME. and then be able to
click on the Color option and see White, Black, Red ONE TIME.
Is this possible?
Thank you for giving your time to read this.!
EvieDo you have a link we can look at to see what you are trying
to do?
Dave
"EviePhillips" <[email protected]> wrote in
message
news:[email protected]...
> The CS3 Dreamweaver book says that the WHERE clause can
create a join for
two
> or more tables. The join was created, but the data is
repeating. I have
> searched the web and this forum and have not found the
answer.
>
> My Master page filters the recordset by Style No and
when a customer
clicks on
> a particular style, it sends him to the Detail page. All
the records are
> showing from all tables on the detail page from the
Dynamic List, except
they
> are showing multiple times (ex. Size table has 4 sizes
and Color table has
2
> colors - my Size Drop Down list is showing 8 options and
my Color Drop
Down
> List is showing 8 options) I have a Master Page with a
recordset pointing
to a
> Detail Page using the same recordset.
>
> Master page works perfectly.
> Master Recordset SQL:
> SELECT products.itemID, products.category,
products.styleno,
products.name,
> products.description, products.ourprice,
products.imageTH, products.image,
> coloroption.color, sizeoption.size
> FROM products, coloroption, sizeoption
> WHERE category = 'chefcoats' AND
products.styleno=sizeoption.styleno AND
> products.styleno=coloroption.styleno
> GROUP BY products.styleno
> ORDER BY styleno ASC
>
> The Detail Recordset:
> SELECT products.itemID, products.category,
products.styleno,
products.name,
> products.description, products.ourprice,
products.imageTH, products.image,
> sizeoption.size, coloroption.color
> FROM products, sizeoption, coloroption
> WHERE itemID=colname AND
products.styleno=sizeoption.styleno AND
> products.styleno=coloroption.styleno
>
> I tried using the GROUP BY on the detail page, but then
it only showed
one
> size and color from the dynamic drop down list. I tried
changing the
field
> name "styleno" in the other tables to be unique,
however, I was using the
table
> identifer. I tried using the JOIN command instead of the
WHERE clause and
that
> didn't help either.
>
> On the detail page, the customer is supposed to click on
the Size box and
see
> sizes XSM - 6XL ONLY ONE TIME. and then be able to click
on the Color
option
> and see White, Black, Red ONE TIME.
>
> Is this possible?
>
> Thank you for giving your time to read this.!
> Evie
>
> -
Using Filter and where clause in GoldenGate
Hi,
I need to use where clause in extract process.
The condition i need to use is :- where (CODE LIKE '10%' OR CODE LIKE '0%')
how to use LIKE operation along with OR in extract.
I have multiple where conditions these are straight i.e = and <> which are working fine. But LIKE is not working.
Please do assist for the same.
Thanks.GoldenGate uses FILTER and SQLPREDICATE (and COMPUTE is a variation that can work, depending on how you are trying to manipulate the data).
To filter data, you can use:
● A FILTER or WHERE clause in a TABLE statement (Extract) or in a MAP statement (Replicat).
● A SQL query or procedure
● User exits
FILTER comparison operators include:
Comparison operators:
> (greater than)
>= (greater than or equal)
< (less than)
<= (less than or equal)
= (equal)
<> (not equal)
WHERE clause permissible operators:
Column names PRODUCT_AMT
Numeric values -123, 5500.123
Literal strings "AUTO", "Ca"
Built-in column tests @NULL, @PRESENT, @ABSENT (column is null, present or absent in the row). These tests are built into Oracle GoldenGate. See “Considerations for selecting rows with FILTER and WHERE” on page 155.
Comparison operators =, <>, >, <, >=, <=
Conjunctive operators AND, OR
Grouping parentheses Use open and close parentheses ( ) for logical grouping of multiple elements.
You could try using a GoldenGate string function. You know what the leading one or two characters (0 and 10) are.
Use the @STREXT function to extract a portion of a string and do a comparison there. Or take care of it using SQLEXEC on replicat (call a function to be able to use LIKE).
Maybe you are looking for
-
Hi, I have an iMac from 2007 operating on Leopard. I've been having trouble with applications freezing, but this morning after being in Safari, everything just froze. I couldn't go to a new web page, I couldn't quit Safari. I can move the arrow, but
-
How do I merge contacts rather than replace them during sync conflicts?
I just got my iPhone 4 a few days ago, and the Verizon sales associate transferred the contacts from my previous phone. Now, when attempting to sync via iTunes 10.4 (80), I'm given only three options after a sync conflict notification regarding conta
-
Sender SOAP Adaptor - how to use an imported WSDL file
I have to implement an inbound soap interface between my client and its external customer.This interface is in place with the legacy system,which has a webservice that the external customer invokes to send us data. Now the problem im facing is, the e
-
I want to associate text files ending with .sml with the Aquamacs Emacs application. If I bring up the info panel on just such a file, and try to use the "Change All..." button, the "Open with:" selector immediately switches back to QuickTime. I can
-
Any description on how to use the Text Editor used for this Forum?
I am very frustrated when trying to use the text Editing functions (without use of HTML, that I do not undertstand) that can be used to create Posts in this Forum . Can somebody point me to a good description of the Text Editor used to enter/edit Pos