public String toSql(boolean first)
	{
		StringBuffer sb = new StringBuffer("\n");

		// Join Type
		switch(joinType) {
			case JT_NONE : sb.append(first ? " FROM " :  ", "); break;
			case JT_INNER : sb.append(" inner join "); break;
			case JT_LEFT_OUTER : sb.append(" left outer join "); break;
			case JT_RIGHT_OUTER : sb.append(" right outer join "); break;
		}

		// Name of Table
		if (asName == null || asName.equals(tableName)) {
			// asName is same
			sb.append(tableName);
			asName = tableName;
		} else {
			// asName is different
			sb.append(tableName + " as " + asName);
		}
		
		// Join Logic
		if (joinType != JT_NONE) {
			sb.append(" on (" + joinLogic + ")");
		}
		
		return sb.toString();
	}